【问题标题】:Froala Wysiwyg - adding custom and toolbar buttons in a custom dropdownFroala Wysiwyg - 在自定义下拉列表中添加自定义和工具栏按钮
【发布时间】: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


    【解决方案1】:

    在与 froala 家伙交谈之后! Custom popup 是一种使用工具栏按钮作为下拉菜单来实现弹出窗口的解决方案。

    谢谢

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多