Ticket #3222: 3222_2.patch
File 3222_2.patch, 2.7 KB (added by , 16 years ago) |
---|
-
_source/core/dom/domobject.js
85 85 var listener = nativeListeners[ eventName ] = getNativeListener( this, eventName ); 86 86 87 87 if ( this.$.addEventListener ) 88 this.$.addEventListener( eventName, listener, false );88 this.$.addEventListener( eventName, listener, !!CKEDITOR.event.useCapture ); 89 89 else if ( this.$.attachEvent ) 90 90 this.$.attachEvent( 'on' + eventName, listener ); 91 91 } -
_source/plugins/floatpanel/plugin.js
102 102 var panel = this._.panel, 103 103 block = panel.showBlock( name ); 104 104 105 this.allowBlur( false ); 105 106 isShowing = true; 106 107 107 108 var element = this.element, … … 134 135 // Non IE prefer the event into a window object. 135 136 var focused = CKEDITOR.env.ie ? iframe : new CKEDITOR.dom.window( iframe.$.contentWindow ); 136 137 137 focused.on( 'blur', function() 138 // With addEventListener compatible browsers, we must 139 // useCapture when registering the focus/blur events to 140 // guarantee they will be firing in all situations. (#3068, #3222 ) 141 CKEDITOR.event.useCapture = true; 142 143 focused.on( 'blur', function( ev ) 138 144 { 145 if ( CKEDITOR.env.ie && !this.allowBlur() ) 146 return; 147 148 // As we are using capture to register the listener, 149 // the blur event may get fired even when focusing 150 // inside the window itself, so we must ensure the 151 // target is out of it. 152 var target = ev.data.getTarget(), 153 targetWindow = target.getWindow && target.getWindow(); 154 155 if ( targetWindow && targetWindow.equals( focused ) ) 156 return; 157 139 158 if ( !this._.activeChild && !isShowing ) 140 159 this.hide(); 141 160 }, … … 145 164 { 146 165 this._.focused = true; 147 166 this.hideChild(); 167 this.allowBlur( true ); 148 168 }, 149 169 this ); 150 170 171 CKEDITOR.event.useCapture = false; 172 151 173 this._.blurSet = 1; 152 174 } 153 175 … … 239 261 } 240 262 }, 241 263 264 allowBlur : function( allow ) // Prevent editor from hiding the panel. #3222. 265 { 266 var panel = this._.panel; 267 if ( allow != undefined ) 268 panel.allowBlur = allow; 269 270 return panel.allowBlur; 271 }, 272 242 273 showAsChild : function( panel, blockName, offsetParent, corner, offsetX, offsetY ) 243 274 { 244 275 this.hideChild();