nisanth074
4/16/2015 - 10:05 AM

Control position of toolbar buttons added by Redactor plugins

Control position of toolbar buttons added by Redactor plugins

RedactorPlugins.fontcolor = function () {
    init: function() {
        // code
        
        // Would be nice to have something like
        this.registerButton(buttonKey, buttonTitle, buttonCallback, buttonDropDown)
        // instead of
        // this.buttonAdd(buttonKey, buttonTitle, buttonCallback, buttonDropDown)
        // which just adds the button to the end of the toolbar
        
        // code
    }
}

$('#redactor').redactor({
    plugins: ['fontcolor'],
    buttons: [
        'formatting',
        '|',
        'bold', 'italic',
        '|',
        'fontcolor', // And then control position of plugin buttons
        '|', 
        'alignment'
    ]
});