theme/javascript/toolbar.js
function createButton(opts) {
    opts = _.defaults(opts || {}, {
        // Aria label for the button
        label: '',

        // Icon to show
        icon: '',

        // Inner text
        text: '',

        // Right or left position
        position: 'left',

        // Other class name to add to the button
        className: '',

        // Triggered when user click on the button
        onClick: defaultOnClick,

        // Button is a dropdown
        dropdown: null,

        // Position in the toolbar
        index: null
    });

    buttons.push(opts);
    updateButton(opts);
}
function createButton(opts) {
    opts = _.defaults(opts || {}, {
        // Aria label for the button
        label: '',

        // Icon to show
        icon: '',

        // Inner text
        text: '',

        // Right or left position
        position: 'left',

        // Other class name to add to the button
        className: '',

        // Triggered when user click on the button
        onClick: defaultOnClick,

        // Button is a dropdown
        dropdown: null,

        // Position in the toolbar
        index: null
    });

    buttons.push(opts);
    updateButton(opts);
}
function createButton ( opts ) { opts = _ . defaults ( opts || { } , { // Aria label for the button label : '' , // Icon to show icon : '' , // Inner text text : '' , // Right or left position position : 'left' , // Other class name to add to the button className : '' , // Triggered when user click on the button onClick : defaultOnClick , // Button is a dropdown dropdown : null , // Position in the toolbar index : null } ) ; buttons . push ( opts ) ; updateButton ( opts ) ; }
Create a new button in the toolbar
Create a new button in the toolbar