define([ 'jquery', 'ui/component', 'ui/utils', 'jqueryui' ], function ( $, Component, Utils ) { 'use strict'; var MenuButton = Component.extend({ init: function () { this.element = MenuButton.makeMenuButton(this); } }); // static functions /** * @param props button properties: * click - if provided will generate a split button, * otherwise just a normal select button. * menu - array of props for nested buttons * text - button text * html - button html * iconUrl - button icon url * siblingContainer * - a $ object that will be searched for other split buttons. * If a split button is expanded, all the other split buttons in * this container will be closed. */ MenuButton.makeMenuButton = function (props) { var wrapper = $('
' , {'class': 'aloha-ui-menubutton-container'}); var expand = Utils.makeButtonElement({'class': 'aloha-ui-menubutton-expand'}); var menu = $('