Opened 7 years ago

Closed 6 years ago

#6589 closed New Feature (fixed)

Make it easier to use iframeDialog

Reported by: alfonsoml Owned by: alfonsoml
Priority: Normal Milestone: CKEditor 3.6
Component: UI : Dialogs Version:
Keywords: Cc:

Description (last modified by alfonsoml)

Currently is not too easy to use the iframeDialog, specially the part about getting the current editor or listening to the dialog events.

The few resources available show The proposal here is to ignore the CKEDITOR.dialog.addIframe and do that work again This page explains the basic usage, but again, it seems that it's extra work

My proposal is to make the CKEDITOR.dialog.addIframe create automatically a function that will notify the inner window of the dialog events (load, ok and cancel), so the only requirement to specify a dialog are two lines, almost like any other dialog:

editor.addCommand( 'myPlugin', new CKEDITOR.dialogCommand( 'myPlugin' ) );
CKEDITOR.dialog.addIframe( 'myPlugin', "Plugin title", this.path + 'popup.html', 700, 470);

And adding a simple function in the iframe:

// Gets notified of events in the main dialog
function onDialogEvent( e )
		case 'load':
			oEditor = e.editor;

		case 'ok':

		case 'cancel':

The patch also includes the #5745 proposal so that way it's possible to alter the default buttons or other behavior in the dialog definition.

Attachments (1)

6589.patch (2.5 KB) - added by alfonsoml 7 years ago.
Proposed patch

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by alfonsoml

Proposed patch

comment:1 Changed 7 years ago by alfonsoml

  • Description modified (diff)
  • Status changed from new to review

comment:2 Changed 6 years ago by wwalc

  • Milestone set to CKEditor 3.6

comment:3 Changed 6 years ago by garry.yao

  • Status changed from review to review_failed

The proposal is a good move, while I wonder if it the level of flexibility is really enough, e.g. it's still impossible to manipulate other dialog fields from within the iframe, I think it's better to just pass in the "dialog" reference, leaving other options to the end developers.

comment:4 Changed 6 years ago by garry.yao

Another important usability issue is #5541, which is right not working for defined "height".

comment:5 Changed 6 years ago by alfonsoml

  • Status changed from review_failed to review

This ticket is about iframeDialogs (all the content is a single iframe), not about a normal dialog where there are several elements and one of them is an iframe.

comment:6 Changed 6 years ago by garry.yao

  • Status changed from review to review_passed

Ok, plus the fixing of #5541.

comment:7 Changed 6 years ago by alfonsoml

  • Resolution set to fixed
  • Status changed from review_passed to closed

Fixed with [6677]

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