Froala自定义关闭按钮

Froala custom close button

本文关键字:关闭按钮 自定义 Froala      更新时间:2023-09-26

我正在尝试为Froala编辑器创建一个自定义的关闭按钮。我已经创建了一个自定义按钮,并将其显示在froala工具栏中,但我似乎无法使关闭按钮正常工作。有人能给我一些指导吗?

到目前为止,我的自定义按钮代码是:

JSON关闭按钮

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

关闭功能

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

您必须使用callback而不是callbackWithoutSelection。文档中对此进行了解释http://editor.froala.com/examples/custom-buttons