redactor.js - How do you add plugin buttons to the left of the default buttons in a redactor editor's toolbar? -


i'm working redactor editor uses several default buttons , number of plugin buttons (e.g. 'fontfamily', 'fontcolor', 'fontsize'). i'd re-order buttons plugin buttons can placed before (i.e. left of) default buttons. not appear natively supported redactor api. how can this?

you need edit plugin code, here basic example of plugin:

if (!redactorplugins) var redactorplugins = {};  redactorplugins.custombutton = function() {     return {         init: function()         {             var button = this.button.add('custom-button', 'add button');             this.button.addcallback(button, this.custombutton.show);         },         show: function()         {             console.log('myplugin show');     }; }; 

you need tweak line (below), within init method.

var button = this.button.add('custom-button', 'add button'); 

this.button.add insert button @ end of toolbar default. can read more other options here http://imperavi.com/redactor/docs/api/button/

but add @ start want addfirst:

var button = this.button.addfirst('custom-button', 'add button'); 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -