【问题标题】:how to re-order etherpad toolbar buttons?如何重新排序 etherpad 工具栏按钮?
【发布时间】:2018-02-24 05:11:27
【问题描述】:

我想重新排序 etherpad 工具栏按钮。对于内置的 etherpad 按钮,可以使用 exports.toolbar 来完成,我发现然后是插件使用 exports.eejsBlock_editbarMenuLeft 钩子添加的按钮。谁能指导我重新订购exports.eejsBlock_editbarMenuLeft钩子添加的那些?虽然我想要的实际订单属于两组,例如打印、导入、上标、粗体等。

【问题讨论】:

    标签: etherpad


    【解决方案1】:

    设置完所有按钮后,您可以使用postToolbarInit 挂钩并使用jQuery 修改顺序。

    exports.postToolbarInit = function (hook, context){
    
      var $superscript = $("#editbar li.superscript");
      var $subscript = $("#editbar li.subscript");
    
      var $underline = $("#editbar li[data-key=\"underline\"]");
    
      $subscript.insertAfter($underline.next("li"));
      $superscript.insertAfter($underline.next().next());
    };
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-15
      • 2023-01-15
      相关资源
      最近更新 更多