﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
8244	tab/shift-tab to indent/outdent <li> elements	Tuomas Salo	Olek Nowodziński	"I'd like Ckeditor to indent/outdent a list item with tab/shift-tab.

I wrote a small (quite untested) patch that aims to do this. Feel free to use this.

{{{
CKEDITOR.plugins.add('liTab', {
    init: function(editor) {
        editor.on('key', function(ev) {
            if( ev.data.keyCode == 9 || ev.data.keyCode == CKEDITOR.SHIFT + 9) {
                if ( editor.focusManager.hasFocus )
                {
                    var sel = editor.getSelection(),
                    ancestor = sel.getCommonAncestor();
                    li = ancestor.getAscendant({li:1, td:1, th:1}, true);
                    if(li && li.$.nodeName == 'LI') {
                        editor.execCommand(ev.data.keyCode == 9 ? 'indent' : 'outdent');
                        ev.cancel();
                    }
                    // else we've found a td/th first, so let's not break the
                    // existing tab functionality in table cells.
                }
                
            }
        }, null, null, 5); // high priority (before the tab plugin)
    }
});

}}}

Known problems:

* one can ""over-indent"" `<li>` elements. (If there are no upper sibling, maybe should do nothing?)

* one can ""under-indent"" `<li>` elements, turning them to `<p>` elements.

I consider both of these problems minor. They are also present when using the indent/outdent buttons in the toolbar, and should be fixed there, if at all."	New Feature	closed	Normal	CKEditor 4.2	Core : Keystrokes		fixed	IE HasPatch IBM Drupal	monahant@… vlq@… satya_minnekanti@… wim.leers@… nate@… billd@…
