Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/386.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Froala自定义关闭按钮_Javascript_Jquery_Editor_Froala - Fatal编程技术网

Javascript Froala自定义关闭按钮

Javascript Froala自定义关闭按钮,javascript,jquery,editor,froala,Javascript,Jquery,Editor,Froala,我正在尝试为Froala编辑器创建一个自定义关闭按钮。我已经成功地创建了一个自定义按钮并将其显示在froala工具栏中,但是我似乎无法使关闭按钮正常工作。有人能给我一些指导吗 到目前为止,我的自定义按钮代码是: JSON关闭按钮 close: { title: "Close", icon: "fa fa-times", refresh: a.Editable.prototype.refreshDefault, undo: !

我正在尝试为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
。文档中对此进行了解释