本文介绍了Froala自定义关闭按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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: {
        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

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

这篇关于Froala自定义关闭按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-18 16:47