我在Froala编辑器的图像弹出窗口中添加了一个自定义按钮。
$.FroalaEditor.DefineIcon('youtubePop', {NAME: 'youtube'});
$.FroalaEditor.RegisterCommand('youtubePop', {
title: 'make YouTube pop-up',
focus: true,
undo: true,
refreshAfterCallback: true,
callback: function () {
// do 2 things here
}
});
单击按钮时,我想做两件事:
答案 0 :(得分:1)
$.FroalaEditor.DefineIcon('youtubePop', {NAME: 'youtube'});
$.FroalaEditor.RegisterCommand('youtubePop', {
title: 'make YouTube pop-up',
focus: true,
undo: true,
refreshAfterCallback: true,
callback: function () {
var $img = editor.image.get();
$img.addClass('my-custom-class').attr('data-foo', 'bar');
}
});