| 1 |
define([ |
| 2 |
"dojo/_base/declare", |
| 3 |
"dojo/_base/kernel", |
| 4 |
"../_Plugin", |
| 5 |
"../../form/ToggleButton" |
| 6 |
], function(declare, kernel, _Plugin, ToggleButton){ |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
kernel.experimental("dijit._editor.plugins.TabIndent"); |
| 12 |
|
| 13 |
|
| 14 |
var TabIndent = declare("dijit._editor.plugins.TabIndent", _Plugin, { |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
useDefaultCommand: false, |
| 22 |
|
| 23 |
|
| 24 |
buttonClass: ToggleButton, |
| 25 |
|
| 26 |
command: "tabIndent", |
| 27 |
|
| 28 |
_initButton: function(){ |
| 29 |
|
| 30 |
this.inherited(arguments); |
| 31 |
|
| 32 |
var e = this.editor; |
| 33 |
this.own(this.button.on("change", function(val){ |
| 34 |
e.set("isTabIndent", val); |
| 35 |
})); |
| 36 |
|
| 37 |
|
| 38 |
this.updateState(); |
| 39 |
}, |
| 40 |
|
| 41 |
updateState: function(){ |
| 42 |
|
| 43 |
|
| 44 |
var disabled = this.get("disabled"); |
| 45 |
this.button.set("disabled", disabled); |
| 46 |
if(disabled){ |
| 47 |
return; |
| 48 |
} |
| 49 |
this.button.set('checked', this.editor.isTabIndent, false); |
| 50 |
} |
| 51 |
}); |
| 52 |
|
| 53 |
|
| 54 |
_Plugin.registry["tabIndent"] = function(){ |
| 55 |
return new TabIndent({command: "tabIndent"}); |
| 56 |
}; |
| 57 |
|
| 58 |
|
| 59 |
return TabIndent; |
| 60 |
}); |