Ticket #3716: 3716_2.patch
File 3716_2.patch, 2.9 KB (added by , 15 years ago) |
---|
-
_source/plugins/floatpanel/plugin.js
128 128 display : '' 129 129 }); 130 130 131 // Non IE prefer the event into a window object. 132 var focused = CKEDITOR.env.ie ? iframe : new CKEDITOR.dom.window( iframe.$.contentWindow ); 133 131 134 // Configure the IFrame blur event. Do that only once. 132 if ( ! this._.blurSet)135 if ( !focused.getCustomData( 'blurSet' ) ) 133 136 { 134 // Non IE prefer the event into a window object.135 var focused = CKEDITOR.env.ie ? iframe : new CKEDITOR.dom.window( iframe.$.contentWindow );136 137 137 focused.on( 'blur', function() 138 138 { 139 if ( ! this._.activeChild&& !isShowing )139 if ( !iframe.getCustomData( 'activeChild' ) && !isShowing ) 140 140 this.hide(); 141 141 }, 142 142 this ); 143 143 144 144 focused.on( 'focus', function() 145 145 { 146 this._.focused = true;146 iframe.setCustomData( 'focused', true ); 147 147 this.hideChild(); 148 148 }, 149 149 this ); 150 150 151 this._.blurSet = 1;151 focused.setCustomData( 'blurSet', true ); 152 152 } 153 153 154 154 panel.onEscape = CKEDITOR.tools.bind( function() … … 232 232 233 233 hide : function() 234 234 { 235 if ( !this.onHide || this.onHide.call( this ) !== true ) 235 var onHide = this._.iframe.getCustomData( 'onHide' ); 236 237 if ( !onHide || onHide.call( this ) !== true ) 236 238 { 237 239 this.hideChild(); 238 240 this.element.setStyle( 'display', 'none' ); … … 241 243 242 244 showAsChild : function( panel, blockName, offsetParent, corner, offsetX, offsetY ) 243 245 { 246 var iframe = this._.iframe; 247 244 248 this.hideChild(); 245 249 246 panel. onHide =CKEDITOR.tools.bind( function()250 panel._.iframe.setCustomData( 'onHide', CKEDITOR.tools.bind( function() 247 251 { 248 252 // Use a timeout, so we give time for this menu to get 249 253 // potentially focused. 250 254 CKEDITOR.tools.setTimeout( function() 251 255 { 252 if ( ! this._.focused)256 if ( !iframe.getCustomData( 'focused' ) ) 253 257 this.hide(); 254 258 }, 255 259 0, this ); 256 260 }, 257 this ) ;261 this ) ); 258 262 259 this._.activeChild = panel;260 this._.focused = false;263 iframe.setCustomData( 'activeChild', panel ); 264 iframe.removeCustomData( 'focused' ); 261 265 262 266 panel.showBlock( blockName, offsetParent, corner, offsetX, offsetY ); 263 267 }, 264 268 265 269 hideChild : function() 266 270 { 267 var activeChild = this._.activeChild; 271 var iframe = this._.iframe; 272 var activeChild = iframe.getCustomData( 'activeChild' ); 268 273 269 274 if ( activeChild ) 270 275 { 271 delete activeChild.onHide;272 delete this._.activeChild;276 activeChild._.iframe.removeCustomData( 'onHide' ); 277 iframe.removeCustomData( 'activeChild' ); 273 278 activeChild.hide(); 274 279 } 275 280 }