Froala custom close button

2019-09-17 05:53发布

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条回答
Summer. ? 凉城
2楼-- · 2019-09-17 06:42

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

查看更多
登录 后发表回答