2 YUI 3.13.0 (build 508226d)
3 Copyright 2013 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
8 YUI.add('editor-tab', function (Y, NAME) {
12 * Handles tab and shift-tab indent/outdent support.
13 * @class Plugin.EditorTab
17 * @submodule editor-tab
20 var EditorTab = function() {
21 EditorTab.superclass.constructor.apply(this, arguments);
24 Y.extend(EditorTab, Y.Base, {
26 * Listener for host's nodeChange event and captures the tabkey interaction.
28 * @method _onNodeChange
29 * @param {Event} e The Event facade passed from the host.
31 _onNodeChange: function(e) {
32 var action = 'indent';
34 if (e.changedType === 'tab') {
35 if (!e.changedNode.test('li, li *')) {
36 e.changedEvent.halt();
38 if (e.changedEvent.shiftKey) {
42 this.get(HOST).execCommand(action, '');
46 initializer: function() {
47 this.get(HOST).on('nodeChange', Y.bind(this._onNodeChange, this));
70 Y.namespace('Plugin');
72 Y.Plugin.EditorTab = EditorTab;
75 }, '3.13.0', {"requires": ["editor-base"]});