【发布时间】:2017-07-30 17:02:54
【问题描述】:
如何添加在 hallo.js 编辑器中添加类的按钮?
这是我的代码,但它不起作用,它只能在 wagtai;s 编辑界面注册功能。 最后,我需要将任何类添加到选择或当前标签。 Mb 我可以以某种方式在 html 中看到它并手动添加类?
(function() {
(function(jQuery) {
return jQuery.widget('IKS.center', {
options: {
editable: null,
toolbar: null,
uuid: '',
buttonCssClass: 'center'
},
populateToolbar: function(toolbar) {
var buttonElement, buttonset;
buttonset = jQuery('<span class="' + this.widgetName + '"></span>');
buttonElement = jQuery('<span></span>');
buttonElement.hallobutton({
uuid: this.options.uuid,
editable: this.options.editable,
label: 'Center element',
command: 'addClass("center")',
icon: 'icon-horizontalrule',
cssClass: this.options.buttonCssClass
});
buttonset.append(buttonElement);
buttonset.hallobuttonset();
return toolbar.append(buttonset);
}
});
})(jQuery);
}).call(this);
【问题讨论】:
标签: javascript django wagtail hallo-js