为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; } );