Ticket #5190: 5190.patch
File 5190.patch, 2.2 KB (added by , 15 years ago) |
---|
-
_source/plugins/templates/dialogs/templates.js
100 100 function keyNavigation( evt ) 101 101 { 102 102 var target = evt.data.getTarget(), 103 position = listContainer.getPosition( target );103 onList = listContainer.equals( target ); 104 104 105 105 // Keyboard navigation for template list. 106 if ( position > CKEDITOR.POSITION_CONTAINS)106 if ( onList || listContainer.contains( target ) ) 107 107 { 108 108 var keystroke = evt.data.getKeystroke(), 109 109 items = listContainer.getElementsByTag( 'a' ), … … 111 111 112 112 if ( items ) 113 113 { 114 switch ( keystroke ) 115 { 116 case 40 : // ARROW-DOWN 117 focusItem = target.getNext(); 118 break; 114 // Focus not yet onto list items? 115 if ( onList ) 116 focusItem = items.getItem( 0 ); 117 else 118 { 119 switch ( keystroke ) 120 { 121 case 40 : // ARROW-DOWN 122 focusItem = target.getNext(); 123 break; 119 124 120 case 38 : // ARROW-UP121 focusItem = target.getPrevious();122 break;125 case 38 : // ARROW-UP 126 focusItem = target.getPrevious(); 127 break; 123 128 124 case 13 : // ENTER 125 case 32 : // SPACE 126 target.fire( 'click' ); 127 } 129 case 13 : // ENTER 130 case 32 : // SPACE 131 target.fire( 'click' ); 132 } 133 } 128 134 129 135 if ( focusItem ) 130 136 { … … 168 174 { 169 175 id : "templatesList", 170 176 type : 'html', 171 focus: function() 172 { 173 // Move focus to the first list item if available. 174 try { this.getElement().getElementsByTag( 'a' ).getItem( 0 ).focus(); } 175 catch( er ){} 176 }, 177 focus: true, 177 178 html : 178 179 '<div class="cke_tpl_list" tabIndex="-1" role="listbox" aria-labelledby="cke_tpl_list_label">' + 179 180 '<div class="cke_tpl_loading"><span></span></div>' +