X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Ftemplates%2Fdialogs%2Ftemplates.js;h=d3d78c670235f7dd6adc3058cda8cdd2b0012bfb;hb=8665a7c6c60586526e32e8941fe2896739b6ebfb;hp=98c8feb88759c614a94fcfcd6e153788f7d8e7c6;hpb=059b4c2fef02528bf1af189f7996e80652faddfb;p=ckeditor.git diff --git a/_source/plugins/templates/dialogs/templates.js b/_source/plugins/templates/dialogs/templates.js index 98c8feb..d3d78c6 100644 --- a/_source/plugins/templates/dialogs/templates.js +++ b/_source/plugins/templates/dialogs/templates.js @@ -41,10 +41,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license '' ); // Build the inner HTML of our new item DIV. - var html = '
'; + html += ' | '; html += ' | ' + template.title + ' '; @@ -100,10 +100,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license function keyNavigation( evt ) { var target = evt.data.getTarget(), - position = listContainer.getPosition( target ); + onList = listContainer.equals( target ); // Keyboard navigation for template list. - if ( position > CKEDITOR.POSITION_CONTAINS ) + if ( onList || listContainer.contains( target ) ) { var keystroke = evt.data.getKeystroke(), items = listContainer.getElementsByTag( 'a' ), @@ -111,19 +111,25 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( items ) { - switch ( keystroke ) + // Focus not yet onto list items? + if ( onList ) + focusItem = items.getItem( 0 ); + else { - case 40 : // ARROW-DOWN - focusItem = target.getNext(); - break; + switch ( keystroke ) + { + case 40 : // ARROW-DOWN + focusItem = target.getNext(); + break; - case 38 : // ARROW-UP - focusItem = target.getPrevious(); - break; + case 38 : // ARROW-UP + focusItem = target.getPrevious(); + break; - case 13 : // ENTER - case 32 : // SPACE - target.fire( 'click' ); + case 13 : // ENTER + case 32 : // SPACE + target.fire( 'click' ); + } } if ( focusItem ) @@ -140,6 +146,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var listContainer; + var templateListLabelId = 'cke_tpl_list_label_' + CKEDITOR.tools.getNextNumber(); return { title :editor.lang.templates.title, @@ -168,17 +175,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { id : "templatesList", type : 'html', - focus: function() - { - // Move focus to the first list item if available. - try { this.getElement().getElementsByTag( 'a' ).getItem( 0 ).focus(); } - catch( er ){} - }, + focus: true, html : - ' ' +
+ ' ' +
' ' +
- '' + editor.lang.common.options+ ''
+ '' + editor.lang.templates.options+ ''
},
{
id : 'chkInsertOpt',
' +
' |