Opened 3 years ago

Closed 3 years ago

#14679 closed Bug (duplicate)

TypeError: Cannot read property 'setAttribute' of undefined

Reported by: sweta Owned by:
Priority: Normal Milestone:
Component: File Browser Version:
Keywords: Cc:

Description

Currently I am using ckeditor version 4.5.7. and in this version I am facing issue with "Uncaught TypeError: Cannot read property 'setAttribute' of undefined" for body element. body.setAttribute("contentEditable", false); Code is as below. Its working fine in firefox. But problem with ie and chrome.

edtr = CKEDITOR.replace(id, {

on: {

'instanceReady': function(evt) {

insert = CKEDITOR.getTemplates('default');

var editor = evt.editor; var body = editor.document.getBody(); body.setAttribute("contentEditable", false);

var disableEvent = function(evt) {

evt.cancelBubble = true; evt.returnValue = false; evt.preventDefault(); evt.stopPropagation();

return false;

};

if (editor.document.$.addEventListener) {

editor.document.$.addEventListener('dragover', disableEvent, true); editor.document.$.addEventListener('drop', disableEvent, true);

} else if (editor.document.$.attachEvent) {

editor.document.$.attachEvent('ondragover', disableEvent, true); editor.document.$.attachEvent('ondrop', disableEvent, true);

} this.fire('afterSetData', main.pageContainerEmailEditor.emaileditor.afterSetData());

}

}

});

Change History (1)

comment:1 Changed 3 years ago by Jakub Ś

Resolution: duplicate
Status: newclosed
Version: 4.5.7

DUP of #14678.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy