function createButton(opts) {
    opts = $.extend({
        // 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,

        // Button id for removal
        id: generateId()
    }, opts || {});

    buttons.push(opts);
    updateButton(opts);

    return opts.id;
}
function createButton(opts) {
    opts = $.extend({
        // 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,

        // Button id for removal
        id: generateId()
    }, opts || {});

    buttons.push(opts);
    updateButton(opts);

    return opts.id;
}
function createButton ( opts ) { opts = $ . extend ( { // 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 , // Button id for removal id : generateId ( ) } , opts || { } ) ; buttons . push ( opts ) ; updateButton ( opts ) ; return opts . id ; }
Create a new button in the toolbar
Create a new button in the toolbar