我正在尝试创建一个 more
自定义下拉菜单,用于在激活toolbarXS时在其下方添加所有工具栏按钮(XS中所有缺少的图标应位于more
下拉菜单下。
不幸的是,文档并不那么清晰,仅输出文本选项,除了显示之外什么也不做。
我想知道是否有人可以帮助我做到这一点。
即
// define annotation button for imagePopup
$.FroalaEditor.DefineIcon('annotationIcon', { NAME: 'pencil'}); // the icon
$.FroalaEditor.RegisterCommand('annotation', { // the button
title: 'Annotation',
icon: 'annotationIcon',
undo: true, // Save the button action into undo stack.
focus: true, // Focus inside the editor before the callback.
showOnMobile: true, // Show the button on mobile or not.
refreshAfterCallback: true, // Refresh the buttons state after the callback.
// Called when the button is hit.
callback: function () {
annotateImage(this);
}
})
// Define `more` dropdown button.
$.FroalaEditor.RegisterCommand('moreDropdown', {
title: 'More',
icon: 'More',
undo: true,
focus: true,
type: 'dropdown',
options: {
"annotation": 'annotation'
},
});
提前致谢
编辑: 我现在能想到的唯一方法是使用
html: function() {
return 'HTML_CODE'
}
然后自己写所有的 ul,这很恶心,而且看起来不是正确的做法。
任何帮助将不胜感激。
最佳答案
与 froala 家伙交谈后! Custom popup 是一个用于实现带有工具栏按钮作为下拉菜单的弹出窗口的解决方案。
谢谢
关于javascript - Froala Wysiwyg - 在自定义下拉列表中添加自定义和工具栏按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43611300/