javascript - Froala Wysiwyg - 在自定义下拉列表中添加自定义和工具栏按钮

标签 javascript wysiwyg froala

我正在尝试创建一个 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/

相关文章:

javascript - 如何从 froala 编辑器中获取文本数据?

javascript - 左边的侧边栏需要两侧

javascript - Tinymce - 是否有可能获得与所见即所得编辑器相对应的文本区域的插入符号位置?

javascript - Froala 编辑器图像编辑选项现在显示

wysiwyg - 如果我可能不会使用它的所见即所得编辑器,Dreamweaver 是否值得购买?

javascript - 文本突出显示 - 内容可编辑

javascript - 无法使用 PHP 的 Froala 编辑器上传图像 URL

javascript - 使用不同的链接创建模态

javascript - 传递多个值以使用anchorscroll

javascript - Canvas 的 drawImage() 不进行子像素渲染/抗锯齿是否存在技术原因?