Ticket #3389: 3389_2.patch
File 3389_2.patch, 4.5 KB (added by , 14 years ago) |
---|
-
_source/plugins/menu/plugin.js
86 86 menu = this._.subMenu = new CKEDITOR.menu( this.editor, this._.level + 1 ); 87 87 menu.parent = this; 88 88 menu.onClick = CKEDITOR.tools.bind( this.onClick, this ); 89 // Sub menu use their own scope for binding onEscape. 90 menu.onEscape = this.onEscape; 89 91 } 90 92 91 93 // Add all submenu items to the menu. … … 138 140 }, 139 141 this._.level); 140 142 141 panel.onEscape = CKEDITOR.tools.bind( function( )143 panel.onEscape = CKEDITOR.tools.bind( function( keystroke ) 142 144 { 143 this.onEscape && this.onEscape();144 this.hide();145 if ( this.onEscape && this.onEscape( keystroke ) === false ) 146 return false; 145 147 }, 146 148 this ); 147 149 … … 186 188 this._.itemClickFn = CKEDITOR.tools.addFunction( function( index ) 187 189 { 188 190 var item = this.items[ index ]; 191 // Focus the corresponding block item. 192 var block = this._.panel.getBlock( this.id ); 193 block._.markItem( index ); 189 194 190 195 if ( item.state == CKEDITOR.TRISTATE_DISABLED ) 191 196 { -
_source/plugins/floatpanel/plugin.js
174 174 this._.blurSet = 1; 175 175 } 176 176 177 panel.onEscape = CKEDITOR.tools.bind( function( )177 panel.onEscape = CKEDITOR.tools.bind( function( keystroke ) 178 178 { 179 this.onEscape && this.onEscape(); 179 if ( this.onEscape && this.onEscape( keystroke ) === false ); 180 return false; 180 181 }, 181 182 this ); 182 183 -
_source/plugins/panel/plugin.js
179 179 return; 180 180 } 181 181 182 if ( keystroke == 27 ) // ESC 183 this.onEscape && this.onEscape(); 182 if ( keystroke == 27 || keystroke == 37 ) // ESC/ARROW-LEFT 183 if ( this.onEscape && this.onEscape( keystroke ) === false ); 184 evt.data.preventDefault(); 184 185 }, 185 186 this ); 186 187 … … 254 255 this._.focusIndex = -1; 255 256 }, 256 257 257 _ : {}, 258 258 _ : { 259 260 /** 261 * Mark the item specified by the index as current activated. 262 */ 263 markItem: function( index ) 264 { 265 if ( index == -1 ) 266 return; 267 var links = this.element.getElementsByTag( 'a' ); 268 links.getItem( this._.focusIndex = index ).focus(); 269 } 270 }, 271 259 272 proto : 260 273 { 261 274 show : function() -
_source/plugins/contextmenu/plugin.js
68 68 noUnlock = false; 69 69 }, this ); 70 70 71 menu.onEscape = function( )71 menu.onEscape = function( keystroke ) 72 72 { 73 editor.focus(); 74 75 if ( CKEDITOR.env.ie ) 76 editor.getSelection().unlock( true ); 73 var parent = this.parent; 74 // 1. If it's submenu, back to upper level. 75 // 2. In case of a top level menu, close it. 76 if( parent ) 77 { 78 parent._.panel.hideChild(); 79 80 // Restore parent block item focus. 81 var parentBlock = parent._.panel._.panel._.currentBlock, 82 parentFocusIndex = parentBlock._.focusIndex; 83 parentBlock._.markItem( parentFocusIndex ); 84 } 85 else if ( keystroke == 27 ) 86 { 87 this.hide(); 88 editor.focus(); 89 90 if ( CKEDITOR.env.ie ) 91 editor.getSelection().unlock( true ); 92 } 93 return false; 77 94 }; 95 78 96 } 79 97 80 98 var listeners = this._.listeners, -
CHANGES.html
138 138 <li>Updated the following language files:<ul> 139 139 <li><a href="http://dev.fckeditor.net/ticket/3837">#3837</a> : Brazilian Portuguese.</li> 140 140 </ul> 141 <li><a href="http://dev.fckeditor.net/ticket/3389">#3389</a> : Adding keystrokes for close sub menu.</li> 141 142 </li> 142 143 </ul> 143 144 <h3>