-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjquery.menubar.min.js
1 lines (1 loc) · 1.78 KB
/
jquery.menubar.min.js
1
var menubarMenu=$.widget("ui.menubarMenu",$.ui.menu,{_keydown:function(a){var b=this.element.find(".ui-state-focus").get(0);if("undefined"!=typeof b&&this.element.get(0)===$(b).parent().get(0))switch(a.keyCode){case $.ui.keyCode.UP:a.keyCode=$.ui.keyCode.LEFT;break;case $.ui.keyCode.DOWN:a.keyCode=$.ui.keyCode.RIGHT;break;case $.ui.keyCode.LEFT:a.keyCode=$.ui.keyCode.UP;break;case $.ui.keyCode.RIGHT:a.keyCode=$.ui.keyCode.DOWN}return this._super(a)},_isDivider:function(a){return"-"===$(a).text()}}),menubar=$.widget("ui.menubar",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenuDown:"ui-icon-carat-1-s",submenuRight:"ui-icon-carat-1-e"},items:"> *",menus:"ul",downPosition:{my:"left top",at:"left bottom"},rightPosition:{my:"left top",at:"right top"},role:"menubar",submenuRole:"menu",blur:null,focus:null,select:null},_create:function(){var a=this;a.element.menubarMenu({icons:{submenu:a.options.submenuRight},items:a.options.items,menus:a.options.menus,position:a.options.downPosition,role:a.options.submenuRole,blur:a.options.blur,focus:function(b,c){a.element.get(0)===$(c).get(0).item.parent().get(0)?$(this).menubarMenu("option","position",a.options.downPosition):$(this).menubarMenu("option","position",a.options.rightPosition),a._trigger("focus",b,c)},select:function(b,c){if(c.item.menubarItemSelected)b.stopPropagation();else{c.item.menubarItemSelected=!0;var d=c.item.children("a").get(0);"undefined"!=typeof d&&d.click(),a._trigger("select",b,c),c.item.menubarItemSelected=!1}}}),a.element.addClass("ui-menubar"),a.element.attr("role",a.options.role),a.element.children(".ui-menu-item").children("."+a.options.icons.submenuRight).each(function(){$(this).removeClass(a.options.icons.submenuRight).addClass(a.options.icons.submenuDown)}),a.element.find("a").prop("tabindex",-1)}});