3 Copyright 2012 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
7 YUI.add('editor-tab', function(Y) {
11 * Handles tab and shift-tab indent/outdent support.
12 * @class Plugin.EditorTab
16 * @submodule editor-tab
19 var EditorTab = function() {
20 EditorTab.superclass.constructor.apply(this, arguments);
23 Y.extend(EditorTab, Y.Base, {
25 * Listener for host's nodeChange event and captures the tabkey interaction.
27 * @method _onNodeChange
28 * @param {Event} e The Event facade passed from the host.
30 _onNodeChange: function(e) {
31 var action = 'indent';
33 if (e.changedType === 'tab') {
34 if (!e.changedNode.test('li, li *')) {
35 e.changedEvent.halt();
37 if (e.changedEvent.shiftKey) {
41 this.get(HOST).execCommand(action, '');
45 initializer: function() {
46 this.get(HOST).on('nodeChange', Y.bind(this._onNodeChange, this));
69 Y.namespace('Plugin');
71 Y.Plugin.EditorTab = EditorTab;
74 }, '3.5.1' ,{skinnable:false, requires:['editor-base']});