src/trumbowyg.js
function (btnName) {
            var t = this,
                prefix = t.o.prefix,
                btn = t.btnsDef[btnName],
                hasIcon = btn.hasIcon != null ? btn.hasIcon : true;

            if (btn.key) {
                t.keys[btn.key] = {
                    fn: btn.fn || btnName,
                    param: btn.param || btnName
                };
            }

            t.tagToButton[(btn.tag || btnName).toLowerCase()] = btnName;

            return $('<button/>', {
                type: 'button',
                class: prefix + btnName + '-dropdown-button ' + (btn.class || '') + (btn.ico ? ' ' + prefix + btn.ico + '-button' : ''),
                html: t.hasSvg && hasIcon ?
                  '<svg><use xlink:href="' + t.svgPath + '#' + prefix + (btn.ico || btnName).replace(/([A-Z]+)/g, '-$1').toLowerCase() + '"/></svg>' + (btn.text || btn.title || t.lang[btnName] || btnName) :
                  (btn.text || btn.title || t.lang[btnName] || btnName),
                title: (btn.key ? '(' + (t.isMac ? 'Cmd' : 'Ctrl') + ' + ' + btn.key + ')' : null),
                style: btn.style || null,
                mousedown: function () {
                    $('body', t.doc).trigger('mousedown');

                    t.execCmd(btn.fn || btnName, btn.param || btnName, btn.forceCss);

                    return false;
                }
            });
        }
function (btnName) {
            var t = this,
                prefix = t.o.prefix,
                btn = t.btnsDef[btnName],
                hasIcon = btn.hasIcon != null ? btn.hasIcon : true;

            if (btn.key) {
                t.keys[btn.key] = {
                    fn: btn.fn || btnName,
                    param: btn.param || btnName
                };
            }

            t.tagToButton[(btn.tag || btnName).toLowerCase()] = btnName;

            return $('<button/>', {
                type: 'button',
                class: prefix + btnName + '-dropdown-button ' + (btn.class || '') + (btn.ico ? ' ' + prefix + btn.ico + '-button' : ''),
                html: t.hasSvg && hasIcon ?
                  '<svg><use xlink:href="' + t.svgPath + '#' + prefix + (btn.ico || btnName).replace(/([A-Z]+)/g, '-$1').toLowerCase() + '"/></svg>' + (btn.text || btn.title || t.lang[btnName] || btnName) :
                  (btn.text || btn.title || t.lang[btnName] || btnName),
                title: (btn.key ? '(' + (t.isMac ? 'Cmd' : 'Ctrl') + ' + ' + btn.key + ')' : null),
                style: btn.style || null,
                mousedown: function () {
                    $('body', t.doc).trigger('mousedown');

                    t.execCmd(btn.fn || btnName, btn.param || btnName, btn.forceCss);

                    return false;
                }
            });
        }
function ( btnName ) { var t = this , prefix = t . o . prefix , btn = t . btnsDef [ btnName ] , hasIcon = btn . hasIcon != null ? btn . hasIcon : true ; if ( btn . key ) { t . keys [ btn . key ] = { fn : btn . fn || btnName , param : btn . param || btnName } ; } t . tagToButton [ ( btn . tag || btnName ) . toLowerCase ( ) ] = btnName ; return $ ( '<button/>' , { type : 'button' , class : prefix + btnName + '-dropdown-button ' + ( btn . class || '' ) + ( btn . ico ? ' ' + prefix + btn . ico + '-button' : '' ) , html : t . hasSvg && hasIcon ? '<svg><use xlink:href="' + t . svgPath + '#' + prefix + ( btn . ico || btnName ) . replace ( / ([A-Z]+) / g , '-$1' ) . toLowerCase ( ) + '"/></svg>' + ( btn . text || btn . title || t . lang [ btnName ] || btnName ) : ( btn . text || btn . title || t . lang [ btnName ] || btnName ) , title : ( btn . key ? '(' + ( t . isMac ? 'Cmd' : 'Ctrl' ) + ' + ' + btn . key + ')' : null ) , style : btn . style || null , mousedown : function ( ) { $ ( 'body' , t . doc ) . trigger ( 'mousedown' ) ; t . execCmd ( btn . fn || btnName , btn . param || btnName , btn . forceCss ) ; return false ; } } ) ; }
Build a button for dropdown menu @param n : name of the subbutton
Build a button for dropdown menu