Skip to content

Commit

Permalink
refs #1438
Browse files Browse the repository at this point in the history
  * 에디터 모드 전환 중에 컨텐트가 누락되는 버그 수정
  • Loading branch information
inureyes committed Mar 30, 2010
1 parent 4d1c809 commit e2f343b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion interface/owner/entry/edit/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ function returnToList() {
</select></dd>
</dl>
<div id="formatbox-container" class="container"></div>
<textarea id="editWindow" name="content" cols="80" rows="20"><?php echo htmlspecialchars($entry['content']);?></textarea>
<textarea id="editWindow" name="content" cols="20" rows="20"><?php echo htmlspecialchars($entry['content']);?></textarea>
<div id="status-container" class="container"><span id="pathStr"><?php echo _t('path');?></span><span class="divider"> : </span><span id="pathContent"></span></div>
<?php
$view = fireEvent('AddPostEditorToolbox', '');
Expand Down
16 changes: 4 additions & 12 deletions plugins/FM_Modern/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ TTModernEditor.prototype.initialize = function(textarea) {
if(this.editMode == "TEXTAREA")
this.iframe.style.display = "none";
// 데이터 싱크 과정.
// if(this.editMode == "WYSIWYG")
// this.syncEditorWindow();
// 가끔씩 Firefox에서 커서가 움직이지 않는 문제 수정
if(!STD.isIE) setTimeout(function() { try { _this.contentDocument.designMode='on'; } catch (e) {} }, 100);
}
Expand Down Expand Up @@ -278,15 +276,10 @@ TTModernEditor.prototype.finalize = function() {
delete TTModernEditor.editors[this.name];
}

TTModernEditor.prototype.syncTextarea = function() {
this.correctContent();
TTModernEditor.prototype.syncContents = function() {
if (this.editMode == "WYSIWYG") {
this.textarea.value = this.html2ttml();
}
}

TTModernEditor.prototype.syncEditorWindow = function() {
if (this.editMode == "WYSIWYG") {
} else if (this.editMode == "TEXTAREA") {
this.contentDocument.body.innerHTML = this.ttml2html();
}
}
Expand Down Expand Up @@ -1694,7 +1687,6 @@ TTModernEditor.prototype.trimContent = function() {
// correct HTML tags generated by browser desingmode to XHTML compatible
TTModernEditor.prototype.correctContent = function() {
var isWYSIWYG = false;

try {
if(this.editMode == "WYSIWYG")
isWYSIWYG = true;
Expand Down Expand Up @@ -2010,17 +2002,18 @@ TTModernEditor.prototype.moveDownFileList = function(id)
// WYSIWYG <-> TEXTAREA 전환
TTModernEditor.prototype.toggleMode = function() {
if(this.editMode == "WYSIWYG") {
this.syncContents();
this.iframe.style.display = "none";
this.textarea.style.display = "block";
this.editMode = "TEXTAREA";
this.textarea.value = this.html2ttml();
this.correctContent();
this.textarea.focus();
this.resizer.target = this.textarea;
}
else {
this.iframe.style.display = "block";
this.textarea.style.display = "none";
this.syncContents();
try { this.contentDocument.designMode = "on"; }
catch(e) {
this.iframe.style.display = "none";
Expand All @@ -2029,7 +2022,6 @@ TTModernEditor.prototype.toggleMode = function() {
}
this.editMode = "WYSIWYG";
this.correctContent();
this.contentDocument.body.innerHTML = this.ttml2html();
try { this.contentDocument.body.focus(); } catch(e) { }
this.resizer.target = this.iframe;
}
Expand Down

0 comments on commit e2f343b

Please sign in to comment.