아

cheditor를 코멘트에 적용했는데... 수정할 때 높이를 늘려주는게 안되네요. ㅠ.ㅠ...

· 2008-06-27 (금) 12:55:21 · 1019
코드를 자세히 보니까 엔터키가 들어가면 아래와 같이 편집기의 높이가 변경됩니다.

editArea.style.height = oEditor.document.body.scrollHeight+40+'px';

편집기를 불러서 사용하는 코드에서는 아래와 같이 에디터를 reset 합니다.

(원본)
function editorReset () {
editor.setEditorOpt();
editor.editArea.focus();
}

(수정본)
function editorReset () {

// 로직만 있고 오류가 나오는 코드입니다.
var areaHeight = parseInt(document.getElementById('wr_content').scrollHeight);
if (areaHeight < 200)
editor.style.height = 200+'px';
else
editor.style.height = document.getElementById('wr_content').scrollHeight+30+'px';

editor.setEditorOpt();
editor.editArea.focus();
}

이경우 어떻게 해야 할까요???



comment.js에서...

doOnKeyPress : function () {
var oEditor = document.getElementById("id"+chutil.oname).contentWindow;
var editArea = document.getElementById("id"+chutil.oname);
var areaHeight = parseInt(editArea.style.height);
var key = oEditor.event.keyCode;

if (key) {
if (key == 13) {
if (GB.autoHeight && oEditor.document.body.scrollHeight+40 > areaHeight)
editArea.style.height = oEditor.document.body.scrollHeight+40+'px';
if (GB.MSIE && oEditor.event.shiftKey == false) {
var sel = oEditor.document.selection.createRange();
oEditor.event.returnValue = false;
oEditor.event.cancelBubble = true;
sel.pasteHTML('<br />');
sel.select();
sel.moveEnd("character", 1);
sel.moveStart("character", 1);
sel.collapse(false);
return false;
}
else
return oEditor.event.keyCode = 13;
}
if (GB.autoHeight && (key == 8 || key == 46) && oEditor.document.body.scrollHeight+30 < areaHeight)
editArea.style.height = oEditor.document.body.scrollHeight+30+'px';
}
},
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
08-06-27 조회 880
08-06-27 조회 857
08-06-27 조회 901
08-06-27 조회 1,047
08-06-27 조회 854
08-06-27 조회 822
08-06-27 조회 1,020
08-06-27 조회 1,031
08-06-27 조회 984
08-06-27 조회 1,722
08-06-27 조회 848
08-06-27 조회 828
08-06-27 조회 1,025
08-06-27 조회 1,048
08-06-27 조회 1,089
08-06-27 조회 1,223
08-06-27 조회 1,093
08-06-27 조회 819
08-06-27 조회 1,031
08-06-26 조회 996