Ticket #9081 (closed Bug: invalid)

Opened 2 years ago

Last modified 2 years ago

U is not a function error

Reported by: krishnank Owned by:
Priority: Normal Milestone:
Component: UI : Dialogs Version: 3.6.2
Keywords: Cc: knimmagadda@…

Description

The following code displays "U is a not a function" error in the browser (firefox).

CKEDITOR.on( 'instanceReady', function( ev ) {

ev.editor.on( 'doubleclick', function( event ) {

var r=event.data.element; if(r.is('div')) {

var dialogObj =

new CKEDITOR.dialog(CKEDITOR.instances.editor1 , 'pomaccordion' );

dialogObj.show();

}

});

});

Attachments

UNotFunction.JPG (13.7 KB) - added by krishnank 2 years ago.
When double clicked on DIV element, the error is displayed.

Change History

Changed 2 years ago by krishnank

When double clicked on DIV element, the error is displayed.

comment:1 Changed 2 years ago by krishnank

When double clicked on DIV element, the error is displayed.

comment:2 Changed 2 years ago by j.swiderski

  • Status changed from new to closed
  • Resolution set to invalid

Dialogs are lazy loaded so your code will only work if smiley dialog was loaded into editor before running this code.

Instead of

var dialogObj = new CKEDITOR.dialog(CKEDITOR.instances.editor1 , 'pomaccordion' );
dialogObj.show();

you should use

event.editor.execCommand( 'pomaccordion'); 
or
event.editor.openDialog( 'pomaccordion' );
Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy