Ticket #3389: 3389.patch
File 3389.patch, 3.9 KB (added by , 14 years ago) |
---|
-
_source/plugins/menu/plugin.js
79 79 menu = this._.subMenu = new CKEDITOR.menu( this.editor, this._.level + 1 ); 80 80 menu.parent = this; 81 81 menu.onClick = CKEDITOR.tools.bind( this.onClick, this ); 82 // Sub menu use their own scope for binding onEscape. 83 menu.onEscape = this.onEscape; 82 84 } 83 85 84 86 // Add all submenu items to the menu. … … 125 127 }, 126 128 this._.level); 127 129 128 panel.onEscape = CKEDITOR.tools.bind( function( )130 panel.onEscape = CKEDITOR.tools.bind( function( keystroke ) 129 131 { 130 this.onEscape && this.onEscape();131 this.hide();132 if ( this.onEscape && this.onEscape( keystroke ) === false ) 133 return false; 132 134 }, 133 135 this ); 134 136 -
_source/plugins/contextmenu/plugin.js
62 62 menu.onHide = null; 63 63 64 64 noUnlock = true; 65 menu.hide(); 66 67 if ( CKEDITOR.env.ie ) 68 menu.onEscape(); 65 menu.onEscape(); 69 66 70 67 if ( item.onClick ) 71 68 item.onClick(); … … 75 72 noUnlock = false; 76 73 }, this ); 77 74 78 menu.onEscape = function( )75 menu.onEscape = function( keystroke ) 79 76 { 80 editor.focus(); 81 82 if ( CKEDITOR.env.ie ) 83 editor.getSelection().unlock( true ); 77 var parent = this.parent; 78 // 1. Close sub menu on ESC/ARROW-RIGHT. 79 // 2. Close menu on ESC. 80 if( parent ) 81 { 82 parent._.panel.hideChild(); 83 84 // Restore parent block item focus. 85 var parentBlock = parent._.panel._.panel._.currentBlock; 86 parentBlock._.markItem( parentBlock._.focusIndex ); 87 return false; 88 } 89 else if ( keystroke == 27 ) 90 { 91 this.hide(); 92 editor.focus(); 93 94 if ( CKEDITOR.env.ie ) 95 editor.getSelection().unlock( true ); 96 return false; 97 } 84 98 }; 99 85 100 } 86 101 87 102 var listeners = this._.listeners, -
_source/plugins/floatpanel/plugin.js
147 147 this._.blurSet = 1; 148 148 } 149 149 150 panel.onEscape = CKEDITOR.tools.bind( function( )150 panel.onEscape = CKEDITOR.tools.bind( function( keystroke ) 151 151 { 152 this.onEscape && this.onEscape(); 152 if ( this.onEscape && this.onEscape( keystroke ) === false ); 153 return false; 153 154 }, 154 155 this ); 155 156 -
_source/plugins/panel/plugin.js
175 175 return; 176 176 } 177 177 178 if ( keystroke == 27 ) // ESC 179 this.onEscape && this.onEscape(); 178 if ( keystroke == 27 || keystroke == 37 ) // ESC/ARROW-LEFT 179 if ( this.onEscape && this.onEscape( keystroke ) === false ); 180 evt.data.preventDefault(); 180 181 }, 181 182 this ); 182 183 … … 250 251 this._.focusIndex = -1; 251 252 }, 252 253 253 _ : {}, 254 _ : { 255 256 /** 257 * Mark the item specified by the index as current activated. 258 */ 259 markItem: function( index ) 260 { 261 var links = this.element.getElementsByTag( 'a' ); 262 links.getItem( this._.focusIndex = index ).focus(); 263 } 264 }, 254 265 255 266 proto : 256 267 { … … 313 324 link = index >= 0 && this.element.getElementsByTag( 'a' ).getItem( index ); 314 325 315 326 if ( link ) 316 link.$.click(); 327 link.$.click? 328 link.$.click() : link.$.onclick(); 317 329 318 330 return false; 319 331 }