为UMEditor添加功能按钮

UM.registerUI('attachment',
    function(name) {
        var me = this;
        var $btn = $.eduibutton({
            icon : name,
            click : function(){
               alert("上传文件");
            },
            title: '上传文件',
        });
        me.addListener('selectionchange',function(){
            //切换为不可编辑时,把自己变灰
            var state = this.queryCommandState(name);
            $btn.edui().disabled(state == -1).active(state == 1)
        });
        return $btn;
    }
);

[ 编辑 | 历史 ]
最近由“jilili”在“2017-04-28 02:34:35”修改