Edge와 Safari에서 'HTML 편집'에서 태그를 직접 수정할 경우 오류가 발생됩니다.

502 views
Skip to first unread message

배은망

unread,
Oct 7, 2015, 6:31:49 AM10/7/15
to chsoft
2015.09.19일자로 문의를 드렸었습니다. 다시 확인해보았는데요~
에디터의 맨하단 'HTML 편집'에서 '입력 모드'로 전환시 아래의 소스중 cursor.selectNode(node);에서 오류를 발생시켜 정상적인 스크립트 제어가 안됩니다.
Edge 브라우저의 개발자 도구(F12)에서 확인이 가능하며 사파리 브라우저에서도 동일한 문제가 발생됩니다.


    if (this.doc.body.hasChildNodes()) {
        var cursor = this.getRange(), selection, node;
        if (this.W3CRange) {
            selection = this.getSelection();
            node = cursor.commonAncestorContainer;
            cursor.selectNode(node); //이 부분에서 오류가 납니다.
            cursor.collapse(false);
            selection.removeAllRanges();
            selection.addRange(cursor);
        }
        else {
            node = this.doc.body.firstChild;
            if (node.nodeType === GB.node.text) {
                node = node.parentNode;
            }
            cursor.moveToElementText(node);
            cursor.collapse(false);
            cursor.select();
        }
    }


chsoft

unread,
Oct 9, 2015, 4:18:06 PM10/9/15
to chsoft
안녕하세요.

말씀하신 부분에 오류가 있습니다.
해당 부분과 더불어 엣지에서 오류가 몇가지 더 발생하고 있습니다.
현재 패치 버전을 준비하고 있습니다.
곧 패치가 완료되면 다시 말씀드리겠습니다.

감사합니다.

2015년 10월 7일 수요일 오후 7시 31분 49초 UTC+9, 배은망 님의 말:

chsoft

unread,
Oct 14, 2015, 4:42:14 AM10/14/15
to chsoft
아래의 두 개 함수를 교체해 주십시오.

richMode 함수(3155번째 줄)는 아래 것으로 바꿔 주십시오.
richMode : function () {
    this.range = null;
    this.cheditor.editArea.style.visibility = 'hidden';
    this.cheditor.toolbarWrapper.style.display = '';
    var content = (this.cheditor.mode === 'preview') ?
        this.getContents(this.config.fullHTMLSource) :
                this.makeHtmlContent();
    this.putContents(this.convertContentsSpacer(content));
    this.cheditor.toolbarWrapper.className = "cheditor-tb-wrapper";
    this.setDesignMode(true);
    this.setImageEvent(true);
    this.cheditor.editArea.style.visibility = 'visible';
    this.editAreaFocus();
    if (this.doc.body.lastChild) {
        this.placeCaretAt(this.doc.body.lastChild, false);
    }   
    else {
        this.initDefaultParagraphSeparator();
    }   
    this.toolbarUpdate();
},

setDesignMode 함수(647번째 줄)도 아래 것으로 바꿔 주십시오.
setDesignMode : function (designMode, doc) {
    if (!doc) {
        doc = this.doc;
    }
   
 if (GB.browser.msie) {
        if (doc.body.contentEditable !== designMode) {
            doc.body.contentEditable = designMode;
        }
        return;
 }
    var mode = designMode ? "on" : "off";
    if (doc.designMode !== mode) {
        doc.designMode = mode;
    }
},

MS 엣지 브라우저의 경우, 확인해 본 결과로 designMode를 중복 지정했을 경우 해당 오류가 발생하는 것 같습니다.
때문에 해당 코드를 수정하였고, 커서와 포커스를 설정하는 이중 코드를 삭제하였습니다.

감사합니다.

2015년 10월 10일 토요일 오전 5시 18분 6초 UTC+9, chsoft 님의 말:
Reply all
Reply to author
Forward
0 new messages