+ else\r
+ element.onContentLoad = function()\r
+ {\r
+ var element = this.getElement(),\r
+ childWindow = element.$.contentWindow;\r
+\r
+ // If the inner frame has defined a "onDialogEvent" function, setup listeners\r
+ if ( childWindow.onDialogEvent )\r
+ {\r
+ var dialog = this.getDialog(),\r
+ notifyEvent = function(e)\r
+ {\r
+ return childWindow.onDialogEvent(e);\r
+ };\r
+\r
+ dialog.on( 'ok', notifyEvent );\r
+ dialog.on( 'cancel', notifyEvent );\r
+ dialog.on( 'resize', notifyEvent );\r
+\r
+ // Clear listeners\r
+ dialog.on( 'hide', function(e)\r
+ {\r
+ dialog.removeListener( 'ok', notifyEvent );\r
+ dialog.removeListener( 'cancel', notifyEvent );\r
+ dialog.removeListener( 'resize', notifyEvent );\r
+\r
+ e.removeListener();\r
+ } );\r
+\r
+ // Notify child iframe of load:\r
+ childWindow.onDialogEvent( {\r
+ name : 'load',\r
+ sender : this,\r
+ editor : dialog._.editor\r
+ } );\r
+ }\r
+ };\r