JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.1.1
[ckeditor.git] / _source / plugins / dialog / plugin.js
index 706c92b..fa4cc99 100644 (file)
@@ -92,14 +92,6 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
                // functions.\r
                definition = new definitionObject( this, definition );\r
 \r
-               // Fire the "dialogDefinition" event, making it possible to customize\r
-               // the dialog definition.\r
-               this.definition = definition = CKEDITOR.fire( 'dialogDefinition',\r
-                       {\r
-                               name : dialogName,\r
-                               definition : definition\r
-                       }\r
-                       , editor ).definition;\r
 \r
                var doc = CKEDITOR.document;\r
 \r
@@ -148,6 +140,14 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
                // Call the CKEDITOR.event constructor to initialize this instance.\r
                CKEDITOR.event.call( this );\r
 \r
+               // Fire the "dialogDefinition" event, making it possible to customize\r
+               // the dialog definition.\r
+               this.definition = definition = CKEDITOR.fire( 'dialogDefinition',\r
+                       {\r
+                               name : dialogName,\r
+                               definition : definition\r
+                       }\r
+                       , editor ).definition;\r
                // Initialize load, show, hide, ok and cancel events.\r
                if ( definition.onLoad )\r
                        this.on( 'load', definition.onLoad );\r
@@ -805,7 +805,7 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
                                                        children : contents.elements,\r
                                                        expand : !!contents.expand,\r
                                                        padding : contents.padding,\r
-                                                       style : contents.style || 'width: 100%;'\r
+                                                       style : contents.style || 'width: 100%;' + ( CKEDITOR.env.ie6Compat ? '' : 'height: 100%;' )\r
                                                }, pageHtml );\r
 \r
                        // Create the HTML for the tab and the content block.\r
@@ -949,7 +949,8 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
                 */\r
                getContentElement : function( pageId, elementId )\r
                {\r
-                       return this._.contents[pageId][elementId];\r
+                       var page = this._.contents[ pageId ];\r
+                       return page && page[ elementId ];\r
                },\r
 \r
                /**\r
@@ -1746,7 +1747,7 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
                        {\r
                                var dialogPos = cursor.getPosition();\r
                                cursor.move( dialogPos.x, dialogPos.y );\r
-                       } while( ( cursor = cursor._.parentDialog ) );\r
+                       } while ( ( cursor = cursor._.parentDialog ) );\r
                };\r
 \r
                resizeCover = resizeFunc;\r
@@ -2777,3 +2778,18 @@ CKEDITOR.plugins.add( 'dialog',
  * @example\r
  * config.dialog_magnetDistance = 30;\r
  */\r
+\r
+/**\r
+ * Fired when a dialog definition is about to be used to create a dialog into\r
+ * an editor instance. This event makes it possible to customize the definition\r
+ * before creating it.\r
+ * <p>Note that this event is called only the first time a specific dialog is\r
+ * opened. Successive openings will use the cached dialog, and this event will\r
+ * not get fired.</p>\r
+ * @name CKEDITOR#dialogDefinition\r
+ * @event\r
+ * @param {CKEDITOR.dialog.dialogDefinition} data The dialog defination that\r
+ *             is being loaded.\r
+ * @param {CKEDITOR.editor} editor The editor instance that will use the\r
+ *             dialog.\r
+ */\r