【发布时间】:2017-04-25 12:55:50
【问题描述】:
我正在尝试创建一个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 ,这很恶心,而且看起来不是正确的做法。
任何帮助将不胜感激。
【问题讨论】:
标签: javascript wysiwyg froala