1 /**
  2  * Add indent button.
  3  * @author yiminghe@gmail.com
  4  */
  5 KISSY.add("editor/plugin/outdent/index", function (S, Editor, indexCmd) {
  6 
  7     function outdent() {
  8 
  9     }
 10 
 11     S.augment(outdent, {
 12         renderUI:function (editor) {
 13 
 14             indexCmd.init(editor);
 15 
 16             editor.addButton("outdent", {
 17                 tooltip:"减少缩进量 ",
 18                 listeners:{
 19                     click:function () {
 20                         editor.execCommand("outdent");
 21                         editor.focus();
 22 
 23                     },
 24                     afterSyncUI:function () {
 25                         var self = this;
 26                         editor.on("selectionChange", function () {
 27                             if (editor.get("mode") == Editor.SOURCE_MODE) {
 28                                 return;
 29                             }
 30                             if (editor.queryCommandValue("outdent")) {
 31                                 self.set("disabled", false);
 32                             } else {
 33                                 self.set("disabled", true);
 34                             }
 35                         });
 36 
 37                     }
 38                 },
 39                 mode:Editor.WYSIWYG_MODE
 40             });
 41         }
 42     });
 43 
 44     return outdent;
 45 
 46 }, {
 47     requires:['editor', './cmd']
 48 });