]>
git.wh0rd.org - tt-rss.git/blob - lib/dijit/_editor/plugins/TabIndent.js.uncompressed.js
1 define("dijit/_editor/plugins/TabIndent", [
2 "dojo/_base/declare", // declare
3 "dojo/_base/kernel", // kernel.experimental
5 "../../form/ToggleButton"
6 ], function(declare
, kernel
, _Plugin
, ToggleButton
){
9 // dijit/_editor/plugins/TabIndent
11 kernel
.experimental("dijit._editor.plugins.TabIndent");
14 var TabIndent
= declare("dijit._editor.plugins.TabIndent", _Plugin
, {
16 // This plugin is used to allow the use of the tab and shift-tab keys
17 // to indent/outdent list items. This overrides the default behavior
18 // of moving focus from/to the toolbar
20 // Override _Plugin.useDefaultCommand... processing is handled by this plugin, not by dijit/Editor.
21 useDefaultCommand
: false,
23 // Override _Plugin.buttonClass to use a ToggleButton for this plugin rather than a vanilla Button
24 buttonClass
: ToggleButton
,
28 _initButton: function(){
29 // Override _Plugin._initButton() to setup listener on button click
30 this.inherited(arguments
);
33 this.connect(this.button
, "onChange", function(val
){
34 e
.set("isTabIndent", val
);
37 // Set initial checked state of button based on Editor.isTabIndent
41 updateState: function(){
42 // Overrides _Plugin.updateState().
43 // Ctrl-m in the editor will switch tabIndent mode on/off, so we need to react to that.
44 var disabled
= this.get("disabled");
45 this.button
.set("disabled", disabled
);
49 this.button
.set('checked', this.editor
.isTabIndent
, false);
53 // Register this plugin.
54 _Plugin
.registry
["tabIndent"] = function(){
55 return new TabIndent({command
: "tabIndent"});