Ticket #3553: 3553.patch
File 3553.patch, 4.6 KB (added by , 16 years ago) |
---|
-
_source/plugins/toolbar/plugin.js
79 79 contents.setStyle( 'height', ( contentHeight - dy ) + 'px' ); 80 80 } ); 81 81 82 var collapserKeystroke = CKEDITOR.tools.addFunction( 83 function( evt ) 84 { 85 var keystroke = evt.getKeystroke(); 86 var toolbox = editor.toolbox; 87 switch ( keystroke ) 88 { 89 case 39 : // RIGHT-ARROW 90 case 9 : // TAB 91 // Put focus to first toolbar item. 92 var item = toolbox.toolbars[ 0 ].items[ 0 ]; 93 item.focus(); 94 evt.preventDefault(); 95 break; 96 case 37 : // LEFT-ARROW 97 case CKEDITOR.SHIFT + 9 : // SHIFT-TAB 98 // Put focus to last toolbar item. 99 var toolbar = toolbox.toolbars[ toolbox.toolbars.length - 1 ]; 100 var item = toolbar.items[ toolbar.items.length - 1 ]; 101 item.focus(); 102 evt.preventDefault(); 103 break; 104 } 105 } ); 106 82 107 var itemKeystroke = function( item, keystroke ) 83 108 { 84 109 switch ( keystroke ) … … 90 115 { /*jsl:pass*/ } 91 116 92 117 // If available, just focus it, otherwise focus the 93 // first one .118 // first one or the collapser. 94 119 if ( item ) 95 120 item.focus(); 96 121 else 97 editor.toolbox.focus(); 122 { 123 if ( editor.toolbox.collapserId ) 124 CKEDITOR.document.getById( editor.toolbox.collapserId ).focus(); 125 else 126 editor.toolbox.focus(); 127 } 98 128 99 129 return false; 100 130 … … 105 135 { /*jsl:pass*/ } 106 136 107 137 // If available, just focus it, otherwise focus the 108 // last one .138 // last one or the collapser. 109 139 if ( item ) 110 140 item.focus(); 111 141 else 112 142 { 113 var lastToolbarItems = editor.toolbox.toolbars[ editor.toolbox.toolbars.length - 1 ].items; 114 lastToolbarItems[ lastToolbarItems.length - 1 ].focus(); 143 if ( editor.toolbox.collapserId ) 144 CKEDITOR.document.getById( editor.toolbox.collapserId ).focus(); 145 else 146 { 147 var lastToolbarItems = editor.toolbox.toolbars[ editor.toolbox.toolbars.length - 1 ].items; 148 lastToolbarItems[ lastToolbarItems.length - 1 ].focus(); 149 } 115 150 } 116 151 117 152 return false; … … 215 250 216 251 if ( editor.config.toolbarCanCollapse ) 217 252 { 218 output.push( '<a class="cke_toolbox_collapser' ); 253 var collapserId = editor.toolbox.collapserId = 'cke_' + CKEDITOR.tools.getNextNumber(); 254 output.push( '<input type="button" class="cke_toolbox_collapser' ); 219 255 220 256 if ( !expanded ) 221 257 output.push( ' cke_toolbox_collapser_min' ); 222 258 223 output.push( '" onclick="CKEDITOR.tools.callFunction(' + collapserFn + ',new CKEDITOR.dom.element(this))"></a>' ); 259 output.push( '" onclick="CKEDITOR.tools.callFunction(' + collapserFn + ',new CKEDITOR.dom.element(this))"' + 260 ' onkeydown="CKEDITOR.tools.callFunction(' + collapserKeystroke + ',new CKEDITOR.dom.event(event))"' + 261 ' id="' + collapserId + '"' + 262 '></input>' ); 224 263 } 225 264 226 265 event.data.html += output.join( '' ); -
_source/skins/v2/toolbar.css
16 16 } 17 17 } 18 18 19 .cke_skin_v2 a.cke_toolbox_collapser,20 .cke_skin_v2 a:hover.cke_toolbox_collapser19 .cke_skin_v2 input.cke_toolbox_collapser, 20 .cke_skin_v2 input:hover.cke_toolbox_collapser 21 21 { 22 22 background-image: url(images/arrowtop.gif); 23 23 background-repeat: no-repeat; … … 30 30 cursor: pointer; 31 31 } 32 32 33 .cke_skin_v2 .cke_rtl a.cke_toolbox_collapser,34 .cke_skin_v2 .cke_rtl a:hover.cke_toolbox_collapser33 .cke_skin_v2 .cke_rtl input.cke_toolbox_collapser, 34 .cke_skin_v2 .cke_rtl input:hover.cke_toolbox_collapser 35 35 { 36 36 float: left; 37 37 } 38 38 39 .cke_skin_v2 a.cke_toolbox_collapser_min,40 .cke_skin_v2 a:hover.cke_toolbox_collapser_min39 .cke_skin_v2 input.cke_toolbox_collapser_min, 40 .cke_skin_v2 input:hover.cke_toolbox_collapser_min 41 41 { 42 42 background-image: url(images/arrowleft.gif); 43 43 margin: 2px; 44 44 } 45 45 46 .cke_skin_v2 .cke_rtl a.cke_toolbox_collapser_min,47 .cke_skin_v2 .cke_rtl a:hover.cke_toolbox_collapser_min46 .cke_skin_v2 .cke_rtl input.cke_toolbox_collapser_min, 47 .cke_skin_v2 .cke_rtl input:hover.cke_toolbox_collapser_min 48 48 { 49 49 background-image: url(images/arrowright.gif); 50 50 }