Ticket #3389: 3389_4.patch
File 3389_4.patch, 5.7 KB (added by , 14 years ago) |
---|
-
_source/plugins/menu/plugin.js
77 77 return; 78 78 } 79 79 80 // Record parent menu focused item first(#3389). 81 var block = this._.panel.getBlock( this.id ); 82 block._.focusIndex = index; 83 84 80 85 // Create the submenu, if not available, or clean the existing 81 86 // one. 82 87 if ( menu ) … … 86 91 menu = this._.subMenu = new CKEDITOR.menu( this.editor, this._.level + 1 ); 87 92 menu.parent = this; 88 93 menu.onClick = CKEDITOR.tools.bind( this.onClick, this ); 94 // Sub menu use their own scope for binding onEscape. 95 menu.onEscape = this.onEscape; 89 96 } 90 97 91 98 // Add all submenu items to the menu. … … 138 145 }, 139 146 this._.level); 140 147 141 panel.onEscape = CKEDITOR.tools.bind( function( )148 panel.onEscape = CKEDITOR.tools.bind( function( keystroke ) 142 149 { 143 this.onEscape && this.onEscape();144 this.hide();150 if ( this.onEscape && this.onEscape( keystroke ) === false ) 151 return false; 145 152 }, 146 153 this ); 147 154 -
_source/core/dom/node.js
25 25 { 26 26 switch ( domNode.nodeType ) 27 27 { 28 // Safari don't consider document as element node type(#3389). 29 case CKEDITOR.NODE_DOCUMENT : 30 return new CKEDITOR.dom.document( domNode ); 31 28 32 case CKEDITOR.NODE_ELEMENT : 29 33 return new CKEDITOR.dom.element( domNode ); 30 34 … … 49 53 CKEDITOR.NODE_ELEMENT = 1; 50 54 51 55 /** 56 * Document node type. 57 * @constant 58 * @example 59 */ 60 CKEDITOR.NODE_DOCUMENT = 9; 61 62 /** 52 63 * Text node type. 53 64 * @constant 54 65 * @example -
_source/plugins/floatpanel/plugin.js
153 153 154 154 focused.on( 'blur', function( ev ) 155 155 { 156 if ( CKEDITOR.env.ie && !this.allowBlur() )157 return;158 159 156 // As we are using capture to register the listener, 160 157 // the blur event may get fired even when focusing 161 158 // inside the window itself, so we must ensure the 162 159 // target is out of it. 163 var target = ev.data.getTarget(),164 targetWindow = target.getWindow && target.getWindow();165 166 if ( targetWindow && targetWindow.equals( focused ))160 var target; 161 if ( CKEDITOR.env.ie && !this.allowBlur() 162 || ( target = ev.data.getTarget() ) 163 && target.getName && target.getName() != 'iframe' ) 167 164 return; 168 165 169 166 if ( this.visible && !this._.activeChild && !isShowing ) … … 184 181 this._.blurSet = 1; 185 182 } 186 183 187 panel.onEscape = CKEDITOR.tools.bind( function( )184 panel.onEscape = CKEDITOR.tools.bind( function( keystroke ) 188 185 { 189 this.onEscape && this.onEscape(); 186 if ( this.onEscape && this.onEscape( keystroke ) === false ); 187 return false; 190 188 }, 191 189 this ); 192 190 -
_source/plugins/panel/plugin.js
180 180 return; 181 181 } 182 182 183 if ( keystroke == 27 ) // ESC 184 this.onEscape && this.onEscape(); 183 if ( keystroke == 27 || keystroke == 37 ) // ESC/ARROW-LEFT 184 if ( this.onEscape && this.onEscape( keystroke ) === false ); 185 evt.data.preventDefault(); 185 186 }, 186 187 this ); 187 188 … … 259 260 CKEDITOR.plugins.contextMenu.prototype.addDisabledTarget( this.element ); 260 261 }, 261 262 262 _ : {}, 263 263 _ : { 264 265 /** 266 * Mark the item specified by the index as current activated. 267 */ 268 markItem: function( index ) 269 { 270 if ( index == -1 ) 271 return; 272 var links = this.element.getElementsByTag( 'a' ); 273 var item = links.getItem( this._.focusIndex = index ); 274 275 // Safari need focus on the iframe window first(#3389), but we need 276 // lock the blur to avoid hiding the panel. 277 if ( CKEDITOR.env.webkit ) 278 item.getDocument().getWindow().focus(); 279 item.focus(); 280 } 281 }, 282 264 283 proto : 265 284 { 266 285 show : function() -
_source/plugins/contextmenu/plugin.js
75 75 noUnlock = false; 76 76 }, this ); 77 77 78 menu.onEscape = function( )78 menu.onEscape = function( keystroke ) 79 79 { 80 editor.focus(); 81 82 if ( CKEDITOR.env.ie ) 83 editor.getSelection().unlock( true ); 80 var parent = this.parent; 81 // 1. If it's sub-menu, restore the last focused item 82 // of upper level menu. 83 // 2. In case of a top-menu, close it. 84 if( parent ) 85 { 86 parent._.panel.hideChild(); 87 // Restore parent block item focus. 88 var parentBlock = parent._.panel._.panel._.currentBlock, 89 parentFocusIndex = parentBlock._.focusIndex; 90 parentBlock._.markItem( parentFocusIndex ); 91 } 92 else if ( keystroke == 27 ) 93 { 94 this.hide(); 95 editor.focus(); 96 97 if ( CKEDITOR.env.ie ) 98 editor.getSelection().unlock( true ); 99 } 100 return false; 84 101 }; 85 102 } 86 103