Froala custom close button

 ̄綄美尐妖づ 提交于 2019-12-11 20:39:18

问题


I'm trying to create a custom close button for the Froala editor. I've managed to create a custom button and have it display in the froala toolbar, however I can't seem to get a close button working correctly. Can anyone give me some guidance?

My code for the custom button so far is:

JSON close button

    close: {
        title: "Close",
        icon: "fa fa-times",
        refresh: a.Editable.prototype.refreshDefault,
        undo: !0,
        callbackWithoutSelection: function(a) {
            this.close_box()
        }
    },

Close function

a.Editable.prototype.close_box = function() {
      alert();
}

回答1:


You have to use callback instead of callbackWithoutSelection. That is explained in the documentation http://editor.froala.com/examples/custom-buttons



来源:https://stackoverflow.com/questions/26335916/froala-custom-close-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!