Changes between Initial Version and Version 1 of Ticket #11075, comment 3


Ignore:
Timestamp:
Nov 27, 2013, 9:15:32 AM (11 years ago)
Author:
Olek Nowodziński
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11075, comment 3

    initial v1  
    55}}}
    66
    7 before `item.execute()` in `itemKeystroke` function (`toolbar.js`) should do the job.
     7before `item.execute()` in `itemKeystroke` function (toolbar plugin) should do the job.
     8
     9----
     10
     11'''Edit''': A better place for the fix could be the button plugin. The trick would correspond with the [https://github.com/ckeditor/ckeditor-dev/blob/d9438ebb67f8c9cbbc4efec30ac846c4a04b750d/plugins/richcombo/plugin.js#L190-L193 similar code] in richcombo if extended those [https://github.com/ckeditor/ckeditor-dev/blob/d9438ebb67f8c9cbbc4efec30ac846c4a04b750d/plugins/button/plugin.js#L142-L147 existing lines]:
     12
     13{{{
     14var keydownFn = CKEDITOR.tools.addFunction( function( ev ) {
     15        if ( instance.onkey ) {
     16                ev = new CKEDITOR.dom.event( ev );
     17                var keystroke = ev.getKeystroke();
     18
     19                if ( keystroke == 40 && instance.button.hasArrow ) {
     20                        editor.once( 'panelShow', function( evt ) {
     21                                evt.data._.panel._.currentBlock.onKeyDown( 40 );
     22                        } );
     23
     24                        return CKEDITOR.tools.callFunction( clickFn, CKEDITOR.document.getById( id ) );
     25                }
     26                else
     27                        return ( instance.onkey( instance, ev.getKeystroke() ) !== false );
     28        }
     29});
     30}}}
     31
     32This approach seems semantically correct because custom keystroke handling should belong to the button, not to the toolbar.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy