2017-04-25 5 views
0

toolbarXSがアクティブになったときにツールバーのボタンを追加するためのカスタムドロップダウンをmoreに作成しようとしています(XSのアイコンがすべてmoreドロップダウン。 残念ながらドキュメントはその明確ではないと示す以外に何もしないテキストのみのオプションを出力する。Froala Wysiwyg - カスタムドロップダウンでカスタムとツールバーのボタンを追加する

誰もがそれを行う方法で助けることができる場合、私は思っていた。

// 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' 
    }, 
}); 
すなわち事前に

おかげ

EDIT: 私は今見つけ出すことができる唯一の方法は、

html: function() { 
    return 'HTML_CODE' 
} 

を使用して、ちょうど嫌で、適切な方法のように思えない自分ですべてのULを書くことですそれをするの。

ご協力いただければ幸いです。

答えて

0

froala男と話した後! Custom popup は、ツールバーのボタンをドロップダウンとしてポップアップを実装するためのソリューションです。

ありがとうございました

関連する問題