www-thermferm/jqwidgets/jqxmenu.js

changeset 511
2d1d43c3a2c2
parent 373
f6850e0b5d35
child 617
b216f9d4b917
equal deleted inserted replaced
510:2da3d3340403 511:2d1d43c3a2c2
1 /* 1 /*
2 jQWidgets v3.8.0 (2015-Apr) 2 jQWidgets v4.5.2 (2017-May)
3 Copyright (c) 2011-2015 jQWidgets. 3 Copyright (c) 2011-2017 jQWidgets.
4 License: http://jqwidgets.com/license/ 4 License: http://jqwidgets.com/license/
5 */ 5 */
6 !function(a){a.jqx.jqxWidget("jqxMenu","",{}),a.extend(a.jqx._jqxMenu.prototype,{defineInstance:function(){var b={items:new Array,mode:"horizontal",width:null,height:null,minimizeWidth:"auto",easing:"easeInOutSine",animationShowDuration:200,animationHideDuration:200,autoCloseInterval:0,animationHideDelay:100,animationShowDelay:100,menuElements:new Array,autoSizeMainItems:!1,autoCloseOnClick:!0,autoCloseOnMouseLeave:!0,enableRoundedCorners:!0,disabled:!1,autoOpenPopup:!0,enableHover:!0,autoOpen:!0,autoGenerate:!0,clickToOpen:!1,showTopLevelArrows:!1,touchMode:"auto",source:null,popupZIndex:17e3,rtl:!1,keyboardNavigation:!1,lockFocus:!1,title:"",events:["shown","closed","itemclick","initialized","open","close"]};return this===a.jqx._jqxMenu.prototype?b:(a.extend(!0,this,b),b)},createInstance:function(b){var c=this;if(this.host.attr("role","menubar"),a.jqx.utilities.resize(this.host,function(){c.refresh()},!1,"popup"!=this.mode),"auto"!=this.minimizeWidth&&null!=this.minimizeWidth&&this.width&&this.width.toString().indexOf("%")==-1&&a(window).resize(function(){c.refresh()}),this.host.css("outline","none"),this.source&&null!=this.source){var d=this.loadItems(this.source);this.element.innerHTML=d}if(this._tmpHTML=this.element.innerHTML,this.element.innerHTML.indexOf("UL")){var e=this.host.find("ul:first");e.length>0&&this._createMenu(e[0])}this.host.data("autoclose",{}),this._render(),this._setSize(),a.jqx.browser.msie&&a.jqx.browser.version<8&&this.host.attr("hideFocus",!0)},focus:function(){try{if("popup"===this.mode&&this.keyboardNavigation){var b=this.host.closest("div.jqx-menu-wrapper");b.focus()}if(this.keyboardNavigation){this.host.focus();var c=this,d=function(){if(a.jqx.isHidden(a(c.items[0].element))){var b=c._nextVisibleItem(c.items[0],0);b&&(a(b.element).addClass(c.toThemeProperty("jqx-fill-state-focus")),c.activeItem=b)}else a(c.items[0].element).addClass(c.toThemeProperty("jqx-fill-state-focus")),c.activeItem=c.items[0]};this.activeItem?a.jqx.isHidden(a(this.activeItem.element))?(a(this.activeItem.element).removeClass(this.toThemeProperty("jqx-fill-state-focus")),d()):a(this.activeItem.element).addClass(this.toThemeProperty("jqx-fill-state-focus")):d()}}catch(a){}},loadItems:function(b,c){if(null!=b){if(0==b.length)return"";var d=this;this.items=new Array;var e='<ul class="jqx-menu-ul">';return c&&(e='<ul class="jqx-menu-ul" style="width:'+c+';">'),a.map(b,function(a){return void 0==a?null:void(e+=d._parseItem(a))}),e+="</ul>"}},_parseItem:function(a){var b="";if(void 0==a)return null;var c=a.label;!a.label&&a.html&&(c=a.html),c||(c="Item"),"string"==typeof a&&(c=a);var d=!1;void 0!=a.selected&&a.selected&&(d=!0);var e=!1;return void 0!=a.disabled&&a.disabled&&(e=!0),b+="<li",e&&(b+=' item-disabled="true" '),a.label&&!a.html&&(b+=' item-label="'+c+'" '),null!=a.value&&(b+=' item-value="'+a.value+'" '),void 0!=a.id&&(b+=' id="'+a.id+'" '),b+=">"+c,a.items&&(b+=a.subMenuWidth?this.loadItems(a.items,a.subMenuWidth):this.loadItems(a.items)),b+="</li>"},_setSize:function(){null!=this.width&&this.width.toString().indexOf("%")!=-1?this.host.width(this.width):null!=this.width&&this.width.toString().indexOf("px")!=-1?this.host.width(this.width):void 0==this.width||isNaN(this.width)||this.host.width(this.width),null!=this.height&&this.height.toString().indexOf("%")!=-1?this.host.height(this.height):null!=this.height&&this.height.toString().indexOf("px")!=-1?this.host.height(this.height):void 0==this.height||isNaN(this.height)||this.host.height(this.height),null===this.height&&this.host.height("auto");if(null!=this.minimizeWidth&&"popup"!=this.mode){var b=a(window).width();if(!a.jqx.response){var c=!1;if(navigator.userAgent.match(/Windows|Linux|MacOS/)){var d=navigator.userAgent.indexOf("Windows Phone")>=0||navigator.userAgent.indexOf("WPDesktop")>=0||navigator.userAgent.indexOf("IEMobile")>=0||navigator.userAgent.indexOf("ZuneWP7")>=0;d||(c=!0)}var e=this.minimizeWidth;if(c&&"auto"==this.minimizeWidth)return}if("auto"==this.minimizeWidth&&a.jqx.response){var f=new a.jqx.response;"Phone"!=f.device.type&&"Tablet"!=f.device.type||this.minimized||this.minimize()}else b<e&&!this.minimized?this.minimize():this.minimized&&b>=e&&this.restore()}},minimize:function(){if(!this.minimized){var b=this;this.host.addClass(this.toThemeProperty("jqx-menu-minimized")),this.minimized=!0,this._tmpMode=this.mode,this.mode="simple";var c=this.host.closest("div.jqx-menu-wrapper");if(c.remove(),a("#menuWrapper"+this.element.id).remove(),a.each(this.items,function(){var b=this,c=(a(b.element),a(b.subMenuElement)),d=c.closest("div.jqx-menu-popup");d.remove()}),this.source){var d=this.loadItems(this.source);this.element.innerHTML=d,this._tmpHTML=this.element.innerHTML}if(this.element.innerHTML=this._tmpHTML,this.element.innerHTML.indexOf("UL")){var e=this.host.find("ul:first");e.length>0&&this._createMenu(e[0])}this._render();var f=this.host.find("ul:first");f.wrap('<div class="jqx-menu-wrapper" style="z-index:'+this.popupZIndex+'; padding: 0px; display: none; margin: 0px; height: auto; width: auto; position: absolute; top: 0; left: 0; display: block; visibility: visible;"></div>');var c=f.closest("div.jqx-menu-wrapper");c[0].id="menuWrapper"+this.element.id,c.detach(),c.appendTo(a(document.body)),c.addClass(this.toThemeProperty("jqx-widget")),c.addClass(this.toThemeProperty("jqx-menu")),c.addClass(this.toThemeProperty("jqx-menu-minimized")),c.addClass(this.toThemeProperty("jqx-widget-header")),f.children().hide(),c.hide(),c.find("ul").addClass(this.toThemeProperty("jqx-menu-ul-minimized")),this.minimizedItem=a("<div></div>"),this.minimizedItem.addClass(this.toThemeProperty("jqx-item")),this.minimizedItem.addClass(this.toThemeProperty("jqx-menu-item-top")),this.addHandler(c,"keydown",function(a){return b.handleKeyDown(a)}),this.minimizedItem.addClass(this.toThemeProperty("jqx-menu-minimized-button")),this.minimizedItem.prependTo(this.host),this.titleElement=a("<div>"+this.title+"</div>"),this.titleElement.addClass(this.toThemeProperty("jqx-item")),this.titleElement.addClass(this.toThemeProperty("jqx-menu-title")),this.titleElement.prependTo(this.host),a("<div style='clear:both;'></div>").insertAfter(this.minimizedItem),b.minimizedHidden=!0;var g=function(a){b.minimizedHidden=!0,b.minimizedItem.show();var d=!1;"right"==b.minimizedItem.css("float")&&(d=!0),c.animate({left:d?b.host.coord().left+b.host.width()+c.width():-c.outerWidth(),opacity:0},b.animationHideDuration,function(){c.find("ul:first").children().hide(),c.hide()})},h=function(a){if(b.minimizedHidden){c.find("ul:first").children().show(),b.minimizedHidden=!1,c.show(),c.css("opacity",0),c.css("left",-c.outerWidth());var d=!1,e=c.width();"right"==b.minimizedItem.css("float")&&(c.css("left",b.host.coord().left+b.host.width()+e),d=!0),c.css("top",b.host.coord().top+b.host.height()),c.animate({left:d?b.host.coord().left+b.host.width()-e:b.host.coord().left,opacity:.95},b.animationShowDuration,function(){})}else g(a);b._raiseEvent("2",{type:"mouse",item:b.minimizedItem[0],event:a}),b._setSize()};this.addHandler(a(window),"orientationchange.jqxmenu"+this.element.id,function(a){setTimeout(function(){if(!b.minimizedHidden){var a=c.width(),d=!1,a=c.width();"right"==b.minimizedItem.css("float")&&(d=!0),c.css("top",b.host.coord().top+b.host.height()),c.css({left:d?b.host.coord().left+b.host.width()-a:b.host.coord().left})}},25)}),this.addHandler(this.minimizedItem,"click",function(a){h(a)})}},restore:function(){if(this.minimized){this.host.find("ul").removeClass(this.toThemeProperty("jqx-menu-ul-minimized")),this.host.removeClass(this.toThemeProperty("jqx-menu-minimized")),this.minimized=!1,this.mode=this._tmpMode,this.minimizedItem&&this.minimizedItem.remove();var b=a("#menuWrapper"+this.element.id);if(b.remove(),this.source){var c=this.loadItems(this.source);this.element.innerHTML=c,this._tmpHTML=c}if(this.element.innerHTML=this._tmpHTML,this.element.innerHTML.indexOf("UL")){var d=this.host.find("ul:first");d.length>0&&this._createMenu(d[0])}this._setSize(),this._render()}},isTouchDevice:function(){if(void 0!=this._isTouchDevice)return this._isTouchDevice;var b=a.jqx.mobile.isTouchDevice();return 1==this.touchMode?b=!0:0==this.touchMode&&(b=!1),b&&(this.host.addClass(this.toThemeProperty("jqx-touch")),a(".jqx-menu-item").addClass(this.toThemeProperty("jqx-touch"))),this._isTouchDevice=b,b},refresh:function(a){a||this._setSize()},resize:function(a,b){this.width=a,this.height=b,this.refresh()},_closeAll:function(b){var c=null!=b?b.data:this,d=c.items;if(a.each(d,function(){var a=this;1==a.hasItems&&a.isOpen&&c._closeItem(c,a)}),"popup"==c.mode&&null!=b){var e=c._isRightClick(b);e||c.close()}},closeItem:function(b){if(null==b)return!1;var c=b,d=document.getElementById(c),e=this;return a.each(e.items,function(){var a=this;1==a.isOpen&&a.element==d&&(e._closeItem(e,a),a.parentId&&e.closeItem(a.parentId))}),!0},openItem:function(b){if(null==b)return!1;var c=b,d=document.getElementById(c),e=this;return a.each(e.items,function(){var a=this;0==a.isOpen&&a.element==d&&(e._openItem(e,a),a.parentId&&e.openItem(a.parentId))}),!0},_getClosedSubMenuOffset:function(b){var c=a(b.subMenuElement),d=-c.outerHeight(),e=-c.outerWidth(),f=0==b.level&&"horizontal"==this.mode;switch(f?e=0:d=0,b.openVerticalDirection){case"up":case"center":d=c.outerHeight()}switch(b.openHorizontalDirection){case this._getDir("left"):e=f?0:c.outerWidth();break;case"center":e=f?0:c.outerWidth()}return{left:e,top:d}},_closeItem:function(b,c,d,e){if(null==b||null==c)return!1;var f=a(c.subMenuElement),g=0==c.level&&"horizontal"==this.mode,h=this._getClosedSubMenuOffset(c),i=h.top,j=h.left,k=(a(c.element),f.closest("div.jqx-menu-popup"));if(null!=k){var l=b.animationHideDelay;1==e&&(l=0),f.data("timer")&&null!=f.data("timer").show&&(clearTimeout(f.data("timer").show),f.data("timer").show=null);var m=function(){c.isOpen=!1,g?f.stop().animate({top:i},b.animationHideDuration,function(){a(c.element).removeClass(b.toThemeProperty("jqx-fill-state-pressed")),a(c.element).removeClass(b.toThemeProperty("jqx-menu-item-top-selected")),a(c.element).removeClass(b.toThemeProperty("jqx-rc-b-expanded")),k.removeClass(b.toThemeProperty("jqx-rc-t-expanded"));var d=a(c.arrow);d.length>0&&b.showTopLevelArrows&&(d.removeClass(),"down"==c.openVerticalDirection?(d.addClass(b.toThemeProperty("jqx-menu-item-arrow-down")),d.addClass(b.toThemeProperty("jqx-icon-arrow-down"))):(d.addClass(b.toThemeProperty("jqx-menu-item-arrow-up")),d.addClass(b.toThemeProperty("jqx-icon-arrow-up")))),a.jqx.aria(a(c.element),"aria-expanded",!1),k.css({display:"none"}),0==b.animationHideDuration&&f.css({top:i}),b._raiseEvent("1",c)}):(!a.jqx.browser.msie,f.stop().animate({left:j},b.animationHideDuration,function(){if(0==b.animationHideDuration&&f.css({left:j}),c.level>0){a(c.element).removeClass(b.toThemeProperty("jqx-fill-state-pressed")),a(c.element).removeClass(b.toThemeProperty("jqx-menu-item-selected"));var d=a(c.arrow);d.length>0&&(d.removeClass(),"left"!=c.openHorizontalDirection?(d.addClass(b.toThemeProperty("jqx-menu-item-arrow-"+b._getDir("right"))),d.addClass(b.toThemeProperty("jqx-icon-arrow-"+b._getDir("right")))):(d.addClass(b.toThemeProperty("jqx-menu-item-arrow-"+b._getDir("left"))),d.addClass(b.toThemeProperty("jqx-icon-arrow-"+b._getDir("left")))))}else{a(c.element).removeClass(b.toThemeProperty("jqx-fill-state-pressed")),a(c.element).removeClass(b.toThemeProperty("jqx-menu-item-top-selected"));var d=a(c.arrow);d.length>0&&(d.removeClass(),"left"!=c.openHorizontalDirection?(d.addClass(b.toThemeProperty("jqx-menu-item-arrow-top-"+b._getDir("right"))),d.addClass(b.toThemeProperty("jqx-icon-arrow-"+b._getDir("right")))):(d.addClass(b.toThemeProperty("jqx-menu-item-arrow-top-"+b._getDir("left"))),d.addClass(b.toThemeProperty("jqx-icon-arrow-"+b._getDir("left")))))}a.jqx.aria(a(c.element),"aria-expanded",!1),k.css({display:"none"}),b._raiseEvent("1",c)}))};if(l>0?f.data("timer")&&(f.data("timer").hide=setTimeout(function(){m()},l)):m(),void 0!=d&&d){var n=f.children();a.each(n,function(){if(b.menuElements[this.id]&&b.menuElements[this.id].isOpen){a(b.menuElements[this.id].subMenuElement);b._closeItem(b,b.menuElements[this.id],!0,!0)}})}}},getSubItems:function(b,c){if(null==b)return!1;var d=this,e=new Array;null!=c&&a.extend(e,c);var f=b,g=this.menuElements[f],h=a(g.subMenuElement),i=h.find(".jqx-menu-item");return a.each(i,function(){e[this.id]=d.menuElements[this.id];var b=d.getSubItems(this.id,e);a.extend(e,b)}),e},disable:function(b,c){if(null!=b){var d=b,e=this;if(this.menuElements[d]){var f=this.menuElements[d];f.disabled=c;var g=a(f.element);f.element.disabled=c,a.each(g.children(),function(){this.disabled=c}),c?(g.addClass(e.toThemeProperty("jqx-menu-item-disabled")),g.addClass(e.toThemeProperty("jqx-fill-state-disabled"))):(g.removeClass(e.toThemeProperty("jqx-menu-item-disabled")),g.removeClass(e.toThemeProperty("jqx-fill-state-disabled")))}}},getItem:function(a){if(this.menuElements[a]){var b=this.menuElements[a];return b}return null},disableItem:function(a){this.disable(a,!0)},hideItem:function(b){if(this.menuElements[b]){var c=this.menuElements[b];a(c.element).hide()}},showItem:function(b){if(this.menuElements[b]){var c=this.menuElements[b];a(c.element).show()}},enableItem:function(a){this.disable(a,!1)},_setItemProperty:function(a,b,c){if(null!=a){var d=a;if(this.menuElements[d]){var e=this.menuElements[d];e[b]&&(e[b]=c)}}},setItemOpenDirection:function(b,c,d){if(null!=b){var e=b,f=this,g=a.jqx.browser.msie&&a.jqx.browser.version<8;if(this.menuElements[e]){var h=this.menuElements[e];if(null!=c&&(h.openHorizontalDirection=c,h.hasItems&&h.level>0)){var i=a(h.element);if(void 0!=i){var j=a(h.arrow);null==h.arrow&&(j=a('<span id="arrow'+i[0].id+'"></span>'),g?j.appendTo(i):j.prependTo(i),h.arrow=j[0]),j.removeClass(),"left"==h.openHorizontalDirection?(j.addClass(f.toThemeProperty("jqx-menu-item-arrow-"+f._getDir("left"))),j.addClass(f.toThemeProperty("jqx-icon-arrow-"+f._getDir("left")))):(j.addClass(f.toThemeProperty("jqx-menu-item-arrow-"+f._getDir("right"))),j.addClass(f.toThemeProperty("jqx-icon-arrow-"+f._getDir("right")))),j.css("visibility","inherit"),g?(j.css("display","inline-block"),j.css("float","none")):(j.css("display","block"),j.css("float","right"))}}if(null!=d){h.openVerticalDirection=d;var j=a(h.arrow),i=a(h.element);if(!f.showTopLevelArrows)return;void 0!=i&&(null==h.arrow&&(j=a('<span id="arrow'+i[0].id+'"></span>'),g?j.appendTo(i):j.prependTo(i),h.arrow=j[0]),j.removeClass(),"down"==h.openVerticalDirection?(j.addClass(f.toThemeProperty("jqx-menu-item-arrow-down")),j.addClass(f.toThemeProperty("jqx-icon-arrow-down"))):(j.addClass(f.toThemeProperty("jqx-menu-item-arrow-up")),j.addClass(f.toThemeProperty("jqx-icon-arrow-up"))),j.css("visibility","inherit"),g?(j.css("display","inline-block"),j.css("float","none")):(j.css("display","block"),j.css("float","right")))}}}},_getSiblings:function(a){for(var b=new Array,c=0,d=0;d<this.items.length;d++)this.items[d]!=a&&this.items[d].parentId==a.parentId&&this.items[d].hasItems&&(b[c++]=this.items[d]);return b},_openItem:function(b,c,d){if(null==b||null==c)return!1;if(c.isOpen)return!1;if(c.disabled)return!1;if(b.disabled)return!1;var e=b.popupZIndex;void 0!=d&&(e=d);var f=b.animationHideDuration;b.animationHideDuration=0,b._closeItem(b,c,!0,!0),b.animationHideDuration=f,a(c.element).focus();var g=[5,5],h=a(c.subMenuElement);null!=h&&h.stop(),h.data("timer")&&null!=h.data("timer").hide&&clearTimeout(h.data("timer").hide);var i=h.closest("div.jqx-menu-popup"),j=a(c.element),k=0==c.level?this._getOffset(c.element):j.position();if(c.level>0&&this.hasTransform){var l=parseInt(j.coord().top)-parseInt(this._getOffset(c.element).top);k.top+=l}0==c.level&&"popup"==this.mode&&(k=j.coord());var m=0==c.level&&"horizontal"==this.mode,n=m?k.left:null!=this.menuElements[c.parentId]&&null!=this.menuElements[c.parentId].subMenuElement?parseInt(a(a(this.menuElements[c.parentId].subMenuElement).closest("div.jqx-menu-popup")).outerWidth())-g[0]:parseInt(h.outerWidth());if(i.css({visibility:"visible",display:"block",left:n,top:m?k.top+j.outerHeight():k.top,zIndex:e}),h.css("display","block"),"horizontal"!=this.mode&&0==c.level){var o=this._getOffset(this.element);i.css("left",-1+o.left+this.host.outerWidth()),h.css("left",-h.outerWidth())}else{var p=this._getClosedSubMenuOffset(c);h.css("left",p.left),h.css("top",p.top)}i.css({height:parseInt(h.outerHeight())+parseInt(g[1])+"px"});var q=0,r=0;switch(c.openVerticalDirection){case"up":if(m){h.css("top",h.outerHeight()),q=g[1];var s=parseInt(h.parent().css("padding-bottom"));isNaN(s)&&(s=0),s>0&&i.addClass(this.toThemeProperty("jqx-menu-popup-clear")),h.css("top",h.outerHeight()-s),i.css({display:"block",top:k.top-i.outerHeight(),zIndex:e})}else q=g[1],h.css("top",h.outerHeight()),i.css({display:"block",top:k.top-i.outerHeight()+g[1]+j.outerHeight(),zIndex:e});break;case"center":m?(h.css("top",0),i.css({display:"block",top:k.top-i.outerHeight()/2+g[1],zIndex:e})):(h.css("top",0),i.css({display:"block",top:k.top+j.outerHeight()/2-i.outerHeight()/2+g[1],zIndex:e}))}switch(c.openHorizontalDirection){case this._getDir("left"):m?i.css({left:k.left-(i.outerWidth()-j.outerWidth()-g[0])}):(r=0,h.css("left",i.outerWidth()),i.css({left:k.left-i.outerWidth()+2*c.level}));break;case"center":m?i.css({left:k.left-(i.outerWidth()/2-j.outerWidth()/2-g[0]/2)}):(i.css({left:k.left-(i.outerWidth()/2-j.outerWidth()/2-g[0]/2)}),h.css("left",i.outerWidth()))}if(m){if(parseInt(h.css("top"))==q)return void(c.isOpen=!0)}else if(parseInt(h.css("left"))==r)return void(1==c.isOpen);a.each(b._getSiblings(c),function(){b._closeItem(b,this,!0,!0)});var t=a.data(b.element,"animationHideDelay");b.animationHideDelay=t,this.autoCloseInterval>0&&(null!=this.host.data("autoclose")&&null!=this.host.data("autoclose").close&&clearTimeout(this.host.data("autoclose").close),null!=this.host.data("autoclose")&&(this.host.data("autoclose").close=setTimeout(function(){b._closeAll()},this.autoCloseInterval))),h.data("timer")&&(h.data("timer").show=setTimeout(function(){if(null!=i)if(m){h.stop(),h.css("left",r),!a.jqx.browser.msie,j.addClass(b.toThemeProperty("jqx-fill-state-pressed")),j.addClass(b.toThemeProperty("jqx-menu-item-top-selected")),"down"==c.openVerticalDirection?(a(c.element).addClass(b.toThemeProperty("jqx-rc-b-expanded")),i.addClass(b.toThemeProperty("jqx-rc-t-expanded"))):(a(c.element).addClass(b.toThemeProperty("jqx-rc-t-expanded")),i.addClass(b.toThemeProperty("jqx-rc-b-expanded")));var d=a(c.arrow);d.length>0&&b.showTopLevelArrows&&(d.removeClass(),"down"==c.openVerticalDirection?(d.addClass(b.toThemeProperty("jqx-menu-item-arrow-down-selected")),d.addClass(b.toThemeProperty("jqx-icon-arrow-down"))):(d.addClass(b.toThemeProperty("jqx-menu-item-arrow-up-selected")),d.addClass(b.toThemeProperty("jqx-icon-arrow-up")))),0==b.animationShowDuration?(h.css({top:q}),c.isOpen=!0,b._raiseEvent("0",c),a.jqx.aria(a(c.element),"aria-expanded",!0)):h.animate({top:q},b.animationShowDuration,b.easing,function(){c.isOpen=!0,a.jqx.aria(a(c.element),"aria-expanded",!0),b._raiseEvent("0",c)})}else{if(h.stop(),h.css("top",q),!a.jqx.browser.msie,c.level>0){j.addClass(b.toThemeProperty("jqx-fill-state-pressed")),j.addClass(b.toThemeProperty("jqx-menu-item-selected"));var d=a(c.arrow);d.length>0&&(d.removeClass(),"left"!=c.openHorizontalDirection?(d.addClass(b.toThemeProperty("jqx-menu-item-arrow-"+b._getDir("right")+"-selected")),d.addClass(b.toThemeProperty("jqx-icon-arrow-"+b._getDir("right")))):(d.addClass(b.toThemeProperty("jqx-menu-item-arrow-"+b._getDir("left")+"-selected")),d.addClass(b.toThemeProperty("jqx-icon-arrow-"+b._getDir("left")))))}else{j.addClass(b.toThemeProperty("jqx-fill-state-pressed")),j.addClass(b.toThemeProperty("jqx-menu-item-top-selected"));var d=a(c.arrow);d.length>0&&(d.removeClass(),"left"!=c.openHorizontalDirection?(d.addClass(b.toThemeProperty("jqx-menu-item-arrow-"+b._getDir("right")+"-selected")),d.addClass(b.toThemeProperty("jqx-icon-arrow-"+b._getDir("right")))):(d.addClass(b.toThemeProperty("jqx-menu-item-arrow-"+b._getDir("left")+"-selected")),d.addClass(b.toThemeProperty("jqx-icon-arrow-"+b._getDir("left")))))}!a.jqx.browser.msie,0==b.animationShowDuration?(h.css({left:r}),b._raiseEvent("0",c),c.isOpen=!0,a.jqx.aria(a(c.element),"aria-expanded",!0)):h.animate({left:r},b.animationShowDuration,b.easing,function(){b._raiseEvent("0",c),c.isOpen=!0,a.jqx.aria(a(c.element),"aria-expanded",!0)})}},this.animationShowDelay))},_getDir:function(a){switch(a){case"left":return this.rtl?"right":"left";case"right":return this.rtl?"left":"right"}return"left"},_applyOrientation:function(b,c){var d=this,e=0;if(d.host.removeClass(d.toThemeProperty("jqx-menu-horizontal")),d.host.removeClass(d.toThemeProperty("jqx-menu-vertical")),d.host.removeClass(d.toThemeProperty("jqx-menu")),d.host.removeClass(d.toThemeProperty("jqx-widget")),d.host.addClass(d.toThemeProperty("jqx-widget")),d.host.addClass(d.toThemeProperty("jqx-menu")),void 0!=b&&void 0!=c&&"popup"==c){if(d.host.parent().length>0&&d.host.parent().parent().length>0&&d.host.parent().parent()[0]==document.body){var f=a.data(document.body,"jqxMenuOldHost"+d.element.id);if(null!=f){var g=d.host.closest("div.jqx-menu-wrapper");g.remove(),g.appendTo(f),d.host.css("display","block"),d.host.css("visibility","visible"),g.css("display","block"),g.css("visibility","visible")}}}else void 0==b&&void 0==c&&a.data(document.body,"jqxMenuOldHost"+d.element.id,d.host.parent()[0]);switch(d.autoOpenPopup?"popup"==d.mode?(d.addHandler(a(document),"contextmenu."+d.element.id,function(a){return!1}),d.addHandler(a(document),"mousedown.menu"+d.element.id,function(a){d._openContextMenu(a)})):(d.removeHandler(a(document),"contextmenu."+d.element.id),d.removeHandler(a(document),"mousedown.menu"+d.element.id)):(d.removeHandler(a(document),"contextmenu."+d.element.id),d.removeHandler(a(document),"mousedown.menu"+d.element.id),d.addHandler(a(document),"contextmenu."+d.element.id,function(a){if(a.target&&a.target.className.indexOf&&a.target.className.indexOf("jqx-menu")>=0)return!1})),d.rtl&&d.host.addClass(d.toThemeProperty("jqx-rtl")),d.mode){case"horizontal":d.host.addClass(d.toThemeProperty("jqx-widget-header")),d.host.addClass(d.toThemeProperty("jqx-menu-horizontal")),a.each(d.items,function(){var b=this;$element=a(b.element);var c=a(b.arrow);if(c.removeClass(),b.hasItems&&b.level>0){var c=a('<span style="border: none; background-color: transparent;" id="arrow'+$element[0].id+'"></span>');c.prependTo($element),c.css("float",d._getDir("right")),c.addClass(d.toThemeProperty("jqx-menu-item-arrow-"+d._getDir("right"))),c.addClass(d.toThemeProperty("jqx-icon-arrow-"+d._getDir("right"))),b.arrow=c[0]}if(0==b.level){if(a(b.element).css("float",d._getDir("left")),!b.ignoretheme&&b.hasItems&&d.showTopLevelArrows){var c=a('<span style="border: none; background-color: transparent;" id="arrow'+$element[0].id+'"></span>'),f=a.jqx.browser.msie&&a.jqx.browser.version<8;null==b.arrow?f?c.appendTo($element):c.prependTo($element):c=a(b.arrow),"down"==b.openVerticalDirection?(c.addClass(d.toThemeProperty("jqx-menu-item-arrow-down")),c.addClass(d.toThemeProperty("jqx-icon-arrow-down"))):(c.addClass(d.toThemeProperty("jqx-menu-item-arrow-up")),c.addClass(d.toThemeProperty("jqx-icon-arrow-up"))),c.css("visibility","inherit"),f?c.css("display","inline-block"):(c.css("display","block"),c.css("float","right")),b.arrow=c[0]}else if(!b.ignoretheme&&b.hasItems&&!d.showTopLevelArrows&&null!=b.arrow){var c=a(b.arrow);c.remove(),b.arrow=null}e=Math.max(e,$element.height())}});break;case"vertical":case"popup":case"simple":if(d.host.addClass(d.toThemeProperty("jqx-menu-vertical")),a.each(d.items,function(){var b=this;if($element=a(b.element),b.hasItems&&!b.ignoretheme){if(b.arrow&&a(b.arrow).remove(),"simple"==d.mode)return!0;var c=a('<span style="border: none; background-color: transparent;" id="arrow'+$element[0].id+'"></span>');c.prependTo($element),c.css("float","right"),0==b.level?(c.addClass(d.toThemeProperty("jqx-menu-item-arrow-top-"+d._getDir("right"))),c.addClass(d.toThemeProperty("jqx-icon-arrow-"+d._getDir("right")))):(c.addClass(d.toThemeProperty("jqx-menu-item-arrow-"+d._getDir("right"))),c.addClass(d.toThemeProperty("jqx-icon-arrow-"+d._getDir("right")))),b.arrow=c[0]}$element.css("float","none")}),"popup"==d.mode){d.host.addClass(d.toThemeProperty("jqx-widget-content")),d.host.wrap('<div tabindex=0 class="jqx-menu-wrapper" style="z-index:'+d.popupZIndex+'; border: none; background-color: transparent; padding: 0px; margin: 0px; position: absolute; top: 0; left: 0; display: block; visibility: visible;"></div>');var g=d.host.closest("div.jqx-menu-wrapper");d.host.addClass(d.toThemeProperty("jqx-popup")),g[0].id="menuWrapper"+d.element.id,g.appendTo(a(document.body)),d.addHandler(g,"keydown",function(a){return d.handleKeyDown(a)})}else d.host.addClass(d.toThemeProperty("jqx-widget-header"));if("popup"==d.mode){var h=d.host.height();d.host.css("position","absolute"),d.host.css("top","0"),d.host.css("left","0"),"simple"!=d.mode&&(d.host.height(h),d.host.css("display","none"))}}var i=d.isTouchDevice();d.autoCloseOnClick&&(d.removeHandler(a(document),"mousedown.menu"+d.element.id,d._closeAfterClick),d.addHandler(a(document),"mousedown.menu"+d.element.id,d._closeAfterClick,d),i&&(d.removeHandler(a(document),a.jqx.mobile.getTouchEventName("touchstart")+".menu"+d.element.id,d._closeAfterClick,d),d.addHandler(a(document),a.jqx.mobile.getTouchEventName("touchstart")+".menu"+d.element.id,d._closeAfterClick,d)))},_getBodyOffset:function(){var b=0,c=0;return"0px"!=a("body").css("border-top-width")&&(b=parseInt(a("body").css("border-top-width")),isNaN(b)&&(b=0)),"0px"!=a("body").css("border-left-width")&&(c=parseInt(a("body").css("border-left-width")),isNaN(c)&&(c=0)),{left:c,top:b}},_getOffset:function(b){var c=a.jqx.mobile.isSafariMobileBrowser(),d=a(b).coord(!0),e=d.top,f=d.left;"0px"!=a("body").css("border-top-width")&&(e=parseInt(e)+this._getBodyOffset().top),"0px"!=a("body").css("border-left-width")&&(f=parseInt(f)+this._getBodyOffset().left);var g=a.jqx.mobile.isWindowsPhone(),h=a.jqx.mobile.isTouchDevice();if(this.hasTransform||null!=c&&c||g||h){var i={left:a.jqx.mobile.getLeftPos(b),top:a.jqx.mobile.getTopPos(b)};return i}return{left:f,top:e}},_isRightClick:function(a){var b;if(!a)var a=window.event;return a.which?b=3==a.which:a.button&&(b=2==a.button),b},_openContextMenu:function(a){var b=this,c=b._isRightClick(a);c&&b.open(parseInt(a.clientX)+5,parseInt(a.clientY)+5)},close:function(){var b=this,c=a.data(this.element,"contextMenuOpened"+this.element.id);if(c){this.host;a.each(b.items,function(){var a=this;a.hasItems&&b._closeItem(b,a)}),a.each(b.items,function(){var b=this;if(1==b.isOpen){$submenu=a(b.subMenuElement);var c=$submenu.closest("div.jqx-menu-popup");c.hide(this.animationHideDuration)}}),this.host.hide(this.animationHideDuration),a.data(b.element,"contextMenuOpened"+this.element.id,!1),b._raiseEvent("1",b),b._raiseEvent("5")}},open:function(b,c){if("popup"==this.mode){var d=0;"block"==this.host.css("display")&&(this.close(),d=this.animationHideDuration);var e=this;void 0!=b&&null!=b||(b=0),void 0!=c&&null!=c||(c=0),setTimeout(function(){e.host.show(e.animationShowDuration),e.host.css("visibility","visible"),a.data(e.element,"contextMenuOpened"+e.element.id,!0),e._raiseEvent("0",e),e._raiseEvent("4",{left:b,top:c}),e.host.css("z-index",9999),void 0!=b&&void 0!=c&&e.host.css({left:b,top:c}),e.focus()},d)}},_renderHover:function(a,b,c){var d=this;b.ignoretheme||(this.addHandler(a,"mouseenter",function(){d.hoveredItem=b,b.disabled||b.separator||!d.enableHover||d.disabled||(b.level>0?(a.addClass(d.toThemeProperty("jqx-fill-state-hover")),a.addClass(d.toThemeProperty("jqx-menu-item-hover"))):(a.addClass(d.toThemeProperty("jqx-fill-state-hover")),a.addClass(d.toThemeProperty("jqx-menu-item-top-hover"))))}),this.addHandler(a,"mouseleave",function(){b.disabled||b.separator||!d.enableHover||d.disabled||(b.level>0?(a.removeClass(d.toThemeProperty("jqx-fill-state-hover")),a.removeClass(d.toThemeProperty("jqx-menu-item-hover"))):(a.removeClass(d.toThemeProperty("jqx-fill-state-hover")),a.removeClass(d.toThemeProperty("jqx-menu-item-top-hover"))))}))},_closeAfterClick:function(b){var c=null!=b?b.data:this,d=!1;c.autoCloseOnClick&&(a.each(a(b.target).parents(),function(){if(this.className.indexOf&&this.className.indexOf("jqx-menu")!=-1)return d=!0,!1}),d||(b.data=c,c._closeAll(b)))},_autoSizeHorizontalMenuItems:function(){var b=this;if(b.autoSizeMainItems&&"horizontal"==this.mode){var c=this.maxHeight;parseInt(c)>parseInt(this.host.height())&&(c=parseInt(this.host.height())),c=parseInt(this.host.height()),a.each(this.items,function(){var d=this;if($element=a(d.element),0==d.level&&c>0){var e=$element.children().length>0?parseInt($element.children().height()):$element.height(),f=b.host.find("ul:first"),g=parseInt(f.css("padding-top")),h=parseInt(f.css("margin-top")),i=c-2*(h+g),j=parseInt(i)/2-e/2,k=parseInt(j),l=parseInt(j);if($element.css("padding-top",k),$element.css("padding-bottom",l),parseInt($element.outerHeight())>i){var m=1;$element.css("padding-top",k-m),k-=m}}})}a.each(this.items,function(){var b=this;if($element=a(b.element),b.hasItems&&b.level>0&&b.arrow){var c=a(b.arrow),d=a(b.element).height();d>15&&c.css("margin-top",(d-15)/2)}})},_nextVisibleItem:function(a,b){if(null==a||void 0==a)return null;for(var c=a;null!=c;)if(c=c.nextItem,this._isVisible(c)&&!c.disabled&&"separator"!==c.type){if(this.minimized)return c;if(void 0!=b&&c&&c.level!=b)continue;return c}return null},_prevVisibleItem:function(a,b){if(null==a||void 0==a)return null;for(var c=a;null!=c;)if(c=c.prevItem,this._isVisible(c)&&!c.disabled&&"separator"!==c.type){if(this.minimized)return c;if(void 0!=b&&c&&c.level!=b)continue;return c}return null},_parentItem:function(b){if(null==b||void 0==b)return null;var c=b.parentElement;if(!c)return null;var d=null;return a.each(this.items,function(){if(this.element==c)return d=this,!1}),d},_isElementVisible:function(b){return null!=b&&("none"!=a(b).css("display")&&"hidden"!=a(b).css("visibility"))},_isVisible:function(a){if(null==a||void 0==a)return!1;if(!this._isElementVisible(a.element))return!1;var b=this._parentItem(a);if(null==b)return!0;if(this.minimized)return!0;if(null!=b){if(!this._isElementVisible(b.element))return!1;if(!b.isOpen&&!this.minimized)return!1;for(;null!=b;){if(b=this._parentItem(b),null!=b&&!this._isElementVisible(b.element))return!1;if(null!=b&&!b.isOpen)return!1}}return!0},_render:function(b,c){this.disabled&&(this.host.addClass(this.toThemeProperty("jqx-fill-state-disabled")),this.host.addClass(this.toThemeProperty("jqx-menu-disabled"))),void 0==this.host.attr("tabindex")&&this.host.attr("tabindex",0);var d=this.popupZIndex,e=[5,5],f=this;a.data(f.element,"animationHideDelay",f.animationHideDelay);var g=this.isTouchDevice(),h=g&&(a.jqx.mobile.isWindowsPhone()||navigator.userAgent.indexOf("Touch")>=0),i=!1;if(navigator.platform.toLowerCase().indexOf("win")!=-1)if(navigator.userAgent.indexOf("Windows Phone")>=0||navigator.userAgent.indexOf("WPDesktop")>=0||navigator.userAgent.indexOf("IEMobile")>=0||navigator.userAgent.indexOf("ZuneWP7")>=0)this.touchDevice=!0;else if(navigator.userAgent.indexOf("Touch")>=0){var j="MSPointerDown"in window;(j||a.jqx.mobile.isWindowsPhone()||navigator.userAgent.indexOf("ARM")>=0)&&(i=!0,h=!0,f.clickToOpen=!0,f.autoCloseOnClick=!1,f.enableHover=!1)}a.data(document.body,"menuel",this),this.hasTransform=a.jqx.utilities.hasTransform(this.host),this._applyOrientation(b,c),this.removeHandler(this.host,"blur"),this.removeHandler(this.host,"focus"),this.addHandler(this.host,"blur",function(b){if(f.keyboardNavigation&&f.activeItem){if("popup"===f.mode&&document.activeElement&&document.activeElement.className.indexOf("jqx-menu-wrapper")>=0)return;a(f.activeItem.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),
7 f.activeItem=null}}),this.addHandler(this.host,"focus",function(b){if(f.keyboardNavigation&&!f.activeItem)if(f.hoveredItem)a(f.hoveredItem.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=f.hoveredItem;else{var c=function(){if(a.jqx.isHidden(a(f.items[0].element))){var b=f._nextVisibleItem(f.items[0],0);b&&(a(b.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=b)}else a(f.items[0].element).addClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=f.items[0]};f.activeItem?a.jqx.isHidden(a(f.activeItem.element))?(a(f.activeItem.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),c()):a(f.activeItem.element).addClass(f.toThemeProperty("jqx-fill-state-focus")):c()}}),this.removeHandler(this.host,"keydown"),f.handleKeyDown=function(b){if(!f.keyboardNavigation)return!0;if("input"===b.target.nodeName.toLowerCase())return!0;var c=null,d=null;a.each(f.items,function(){return!!this.disabled||(this.element.className.indexOf("pressed")>=0&&(d=this),this.element.className.indexOf("focus")>=0?(c=this,!1):void 0)}),!c&&d&&(c=d),c||(a(f.items[0].element).addClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=f.items[0],c=f.activeItem);var e=!1;if(27==b.keyCode){if(b.data=f,f._closeAll(b),c)for(var g=c;null!=g;)g.parentItem?g=g.parentItem:(a(f.activeItem.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=g,a(f.activeItem.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),g=g.parentItem);e=!0}if(13==b.keyCode&&c){e=!0,f._raiseEvent("2",{item:c.element,event:b,type:"keyboard"});var h=null!=c.anchor?a(c.anchor):null;if(null!=h&&h.length>0){var i=h.attr("href"),j=h.attr("target");null!=i&&(null!=j?window.open(i,j):window.location=i)}b.preventDefault(),b.stopPropagation(),a(c.element).focus()}var k=function(a){if(null==a)return new Array;for(var b=new Array,c=0,d=0;d<f.items.length;d++)f.items[d].parentId==a.parentId&&(b[c++]=f.items[d]);return b},l="";switch(b.keyCode){case 40:l="down";break;case 38:l="up";break;case 39:l="right";break;case 37:l="left"}if(c&&"left"===c.openHorizontalDirection&&"left"===l&&(l="right"),c&&"left"===c.openHorizontalDirection&&"right"===l&&(l="left"),c&&"top"===c.openVerticalDirection&&"top"===l&&(l="bottom"),c&&"top"===c.openVerticalDirection&&"bottom"===l&&(l="top"),f.rtl&&("right"===l?l="left":"left"===l&&(l="right")),"right"===l&&!f.minimized){if(b.altKey&&(0!=c.level&&c.hasItems||"horizontal"!=f.mode))f._openItem(f,c);else{var m=f._nextVisibleItem(c,0),n=f._nextVisibleItem(c),o=k(n);m||(m=n),m&&(m.parentId===c.parentId&&0==m.level&&"horizontal"==f.mode||n.id==o[0].id&&0!=n.level)&&(n.id==o[0].id&&(0!=c.level||0==c.level&&"horizontal"!=f.mode)&&(m=n),a(m.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),a(c.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=m)}b.preventDefault(),b.stopPropagation()}if("left"===l&&!f.minimized){if(b.altKey&&(0!=c.level&&"horizontal"!==f.mode||c.level>1&&"horizontal"===f.mode||1==c.level&&c.hasItems&&"horizontal"===f.mode))c.hasItems?f._closeItem(f,c):c.parentItem&&(f._closeItem(f,c.parentItem),a(c.parentItem.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),a(c.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=c.parentItem);else{var m=f._prevVisibleItem(c,0),p=c.parentItem;m&&m.parentId===c.parentId&&0==m.level&&"horizontal"==f.mode?(a(m.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),a(c.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=m):p&&0==p.level&&"horizontal"==f.mode||!p||p.level!=c.level-1||(a(p.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),a(c.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=p)}b.preventDefault(),b.stopPropagation()}if("down"===l){if(b.altKey)0==c.level&&c.hasItems&&f._openItem(f,c),f.minimized&&f.minimizedHidden&&f.minimizedItem.trigger("click");else{var m=f._nextVisibleItem(c,c.level),o=k(m);if(f.minimized&&m)a(m.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),a(c.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=m;else if(m&&(m.parentId===c.parentId||m.id==o[0].id&&"horizontal"==f.mode)&&(0==m.level&&"horizontal"==f.mode||(a(m.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),a(c.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=m)),"horizontal"===f.mode&&0===c.level&&c.isOpen&&c.hasItems){var m=f._nextVisibleItem(c);a(m.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),a(c.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=m}}b.preventDefault(),b.stopPropagation()}else if("up"===l){if(b.altKey)c.parentItem&&0==c.parentItem.level?(f._closeItem(f,c.parentItem),a(c.parentItem.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),a(c.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=c.parentItem):null===c.parentItem&&0===c.level&&"horizontal"===f.mode&&f._closeItem(f,c),f.minimized&&(f.minimizedHidden||f.minimizedItem.trigger("click"));else{var m=f._prevVisibleItem(c,c.level),o=k(c);if(f.minimized&&m)a(m.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),a(c.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=m;else if(m&&(m.parentId===c.parentId||m.id==c.parentId&&0==m.level&&"horizontal"==f.mode))0==m.level&&"horizontal"===f.mode&&0===c.level||(a(m.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),a(c.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=m);else if(c&&c.id==o[0].id&&c.parentItem&&0===c.parentItem.level&&"horizontal"===f.mode){var m=c.parentItem;a(m.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),a(c.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=m}}b.preventDefault(),b.stopPropagation()}if(9==b.keyCode){var m=b.shiftKey?f._prevVisibleItem(c):f._nextVisibleItem(c);if(m)a(m.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),a(c.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=m,b.preventDefault(),b.stopPropagation();else if(f.lockFocus){for(var o=new Array,q=0,r=0;r<f.items.length;r++)f.items[r]!=c&&f.items[r].parentId==c.parentId&&(o[q++]=f.items[r]);o.length>0&&(b.shiftKey?(a(o[o.length-1].element).addClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=o[o.length-1]):(a(o[0].element).addClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=o[0]),a(c.element).removeClass(f.toThemeProperty("jqx-fill-state-focus"))),b.preventDefault(),b.stopPropagation()}else c&&(a(c.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=null)}},this.addHandler(this.host,"keydown",function(a){f.handleKeyDown(a)}),f.enableRoundedCorners&&this.host.addClass(f.toThemeProperty("jqx-rc-all")),a.each(this.items,function(){var b=this,c=a(b.element);if(c.attr("role","menuitem"),f.enableRoundedCorners&&c.addClass(f.toThemeProperty("jqx-rc-all")),f.removeHandler(c,"click"),f.addHandler(c,"click",function(c){if(!b.disabled&&!f.disabled&&(f.keyboardNavigation&&(f.activeItem&&a(f.activeItem.element).removeClass(f.toThemeProperty("jqx-fill-state-focus")),f.activeItem=b,a(b.element).addClass(f.toThemeProperty("jqx-fill-state-focus")),f.minimized&&c.stopPropagation()),f._raiseEvent("2",{type:"mouse",item:b.element,event:c}),f.autoOpen?!f.autoCloseOnClick||g||f.clickToOpen||b.closeOnClick&&(c.data=f,f._closeAll(c)):b.level>0&&(!f.autoCloseOnClick||g||f.clickToOpen||(c.data=f,f._closeAll(c))),g&&f.autoCloseOnClick&&(c.data=f,b.hasItems||f._closeAll(c)),"A"!=c.target.tagName&&"a"!=c.target.tagName)){var d=null!=b.anchor?a(b.anchor):null;if(null!=d&&d.length>0){var e=d.attr("href"),h=d.attr("target");null!=e&&(null!=h?window.open(e,h):window.location=e)}}}),f.removeHandler(c,"mouseenter"),f.removeHandler(c,"mouseleave"),h||"simple"==f.mode||f._renderHover(c,b,g),null!=b.subMenuElement){var i=a(b.subMenuElement);if("simple"==f.mode)return i.show(),!0;i.wrap('<div class="jqx-menu-popup '+f.toThemeProperty("jqx-menu-popup")+'" style="border: none; background-color: transparent; z-index:'+d+'; padding: 0px; margin: 0px; position: absolute; top: 0; left: 0; display: block; visibility: hidden;"><div style="background-color: transparent; border: none; position:absolute; overflow:hidden; left: 0; top: 0; right: 0; width: 100%; height: 100%;"></div></div>'),i.css({overflow:"hidden",position:"absolute",left:0,display:"inherit",top:-i.outerHeight()}),i.data("timer",{}),b.level>0?i.css("left",-i.outerWidth()):"horizontal"==f.mode&&i.css("left",0),d++;var j=a(b.subMenuElement).closest("div.jqx-menu-popup").css({width:parseInt(a(b.subMenuElement).outerWidth())+parseInt(e[0])+"px",height:parseInt(a(b.subMenuElement).outerHeight())+parseInt(e[1])+"px"}),k=c.closest("div.jqx-menu-popup");if(k.length>0){var l=i.css("margin-left"),m=i.css("margin-right"),n=i.css("padding-left"),o=i.css("padding-right");j.appendTo(k),i.css("margin-left",l),i.css("margin-right",m),i.css("padding-left",n),i.css("padding-right",o)}else{var l=i.css("margin-left"),m=i.css("margin-right"),n=i.css("padding-left"),o=i.css("padding-right");j.appendTo(a(document.body)),i.css("margin-left",l),i.css("margin-right",m),i.css("padding-left",n),i.css("padding-right",o)}f.clickToOpen?(f.removeHandler(c,"mousedown"),f.addHandler(c,"mousedown",function(a){clearTimeout(i.data("timer").hide),null!=i&&i.stop(),0!=b.level||b.isOpen||(a.data=f,f._closeAll(a)),b.isOpen?f._closeItem(f,b,!0):f._openItem(f,b)})):((g||h)&&(f.removeHandler(c,a.jqx.mobile.getTouchEventName("touchstart")),f.addHandler(c,a.jqx.mobile.getTouchEventName("touchstart"),function(a){return clearTimeout(i.data("timer").hide),null!=i&&i.stop(),0!=b.level||b.isOpen||"popup"==f.mode||(a.data=f,f._closeAll(a)),b.isOpen?f._closeItem(f,b,!0):f._openItem(f,b),!1})),h||(f.addHandler(c,"mouseenter",function(){if((f.autoOpen||b.level>0&&!f.autoOpen)&&clearTimeout(i.data("timer").hide),b.parentId&&0!=b.parentId&&f.menuElements[b.parentId]){var a=f.menuElements[b.parentId].isOpen;if(!a)return}return(f.autoOpen||b.level>0&&!f.autoOpen)&&f._openItem(f,b),!1}),f.addHandler(c,"mousedown",function(){f.autoOpen||0!=b.level||(clearTimeout(i.data("timer").hide),null!=i&&i.stop(),b.isOpen?f._closeItem(f,b,!0):f._openItem(f,b))}),f.addHandler(c,"mouseleave",function(c){if(f.autoCloseOnMouseLeave){clearTimeout(i.data("timer").hide);var d=a(b.subMenuElement),e={left:parseInt(c.pageX),top:parseInt(c.pageY)},g={left:parseInt(d.coord().left),top:parseInt(d.coord().top),width:parseInt(d.outerWidth()),height:parseInt(d.outerHeight())},h=!0;g.left-5<=e.left&&e.left<=g.left+g.width+5&&g.top<=e.top&&e.top<=g.top+g.height&&(h=!1),h&&f._closeItem(f,b,!0)}}),f.removeHandler(j,"mouseenter"),f.addHandler(j,"mouseenter",function(){clearTimeout(i.data("timer").hide)}),f.removeHandler(j,"mouseleave"),f.addHandler(j,"mouseleave",function(a){f.autoCloseOnMouseLeave&&(clearTimeout(i.data("timer").hide),clearTimeout(i.data("timer").show),null!=i&&i.stop(),f._closeItem(f,b,!0))})))}}),"simple"==this.mode&&this._renderSimpleMode(),this._autoSizeHorizontalMenuItems(),this._raiseEvent("3",this)},_renderSimpleMode:function(){this.host.show()},createID:function(){var a=Math.random()+"";for(a=a.replace(".",""),a="99"+a,a/=1;this.items[a];)a=Math.random()+"",a=a.replace(".",""),a/=1;return"menuItem"+a},_createMenu:function(b,c){if(null!=b){void 0==c&&(c=!0),null==c&&(c=!0);var d=a(b).find("li"),e=0;this.itemMapping=new Array;for(var f=0;f<d.length;f++){var g=d[f],h=a(g);if(g.className.indexOf("jqx-menu")!=-1||0!=this.autoGenerate){var i=g.id;i||(i=this.createID()),c&&(g.id=i,this.items[e]=new a.jqx._jqxMenu.jqxMenuItem,this.menuElements[i]=this.items[e]),e+=1;var j=0,k=this,l=h.children();l.each(function(){return c||(this.className="",k.autoGenerate&&(a(k.items[e-1].subMenuElement)[0].className="",k.minimized||a(k.items[e-1].subMenuElement).addClass(k.toThemeProperty("jqx-widget-content")),a(k.items[e-1].subMenuElement).addClass(k.toThemeProperty("jqx-menu-dropdown")),a(k.items[e-1].subMenuElement).addClass(k.toThemeProperty("jqx-popup")))),this.className.indexOf("jqx-menu-dropdown")!=-1?(c&&(k.items[e-1].subMenuElement=this),!1):!k.autoGenerate||"ul"!=this.tagName&&"UL"!=this.tagName?void 0:(c&&(k.items[e-1].subMenuElement=this),this.className="",k.minimized||a(this).addClass(k.toThemeProperty("jqx-widget-content")),a(this).addClass(k.toThemeProperty("jqx-menu-dropdown")),a(this).addClass(k.toThemeProperty("jqx-popup")),a(this).attr("role","menu"),k.rtl?a(this).addClass(k.toThemeProperty("jqx-rc-l")):a(this).addClass(k.toThemeProperty("jqx-rc-r")),a(this).addClass(k.toThemeProperty("jqx-rc-b")),!1)});var m=h.parents();m.each(function(){return this.className.indexOf("jqx-menu-item")!=-1?(j=this.id,!1):!k.autoGenerate||"li"!=this.tagName&&"LI"!=this.tagName?void 0:(j=this.id,!1)});var n=!1,o=g.getAttribute("type"),p=g.getAttribute("ignoretheme")||g.getAttribute("data-ignoretheme");if(p?"true"!=p&&1!=p||(p=!0):p=!1,o){if("separator"==o)var n=!0}else o=g.type;n||(o=j?"sub":"top");var q=this.items[e-1];if(c){q.id=i,q.parentId=j,q.type=o,q.separator=n,q.element=d[f];var r=h.children("a");q.disabled="true"==g.getAttribute("item-disabled"),q.level=h.parents("li").length,q.anchor=r.length>0?r:null,q.anchor&&a(q.anchor).attr("tabindex",-1)}q.ignoretheme=p;var s=this.menuElements[j];null!=s&&(s.ignoretheme&&(q.ignoretheme=s.ignoretheme,p=s.ignoretheme),q.parentItem=s,q.parentElement=s.element),this.autoGenerate&&("separator"==o?(h.removeClass(),h.addClass(this.toThemeProperty("jqx-menu-item-separator")),h.attr("role","separator")):p||(h[0].className.indexOf("jqx-grid-menu-item-touch")>=0?h[0].className=this.toThemeProperty("jqx-grid-menu-item-touch"):h[0].className="",this.rtl&&h.addClass(this.toThemeProperty("jqx-rtl")),q.level>0&&!k.minimized?(h.addClass(this.toThemeProperty("jqx-item")),h.addClass(this.toThemeProperty("jqx-menu-item"))):(h.addClass(this.toThemeProperty("jqx-item")),h.addClass(this.toThemeProperty("jqx-menu-item-top"))))),q.disabled&&(h.addClass(k.toThemeProperty("jqx-menu-item-disabled")),h.addClass(k.toThemeProperty("jqx-fill-state-disabled"))),this.itemMapping[f]={element:d[f],item:q},this.itemMapping["id"+d[f].id]=this.itemMapping[f],c&&!p&&(q.hasItems=h.find("li").length>0,q.hasItems&&q.element&&(a.jqx.aria(a(q.element),"aria-haspopup",!0),q.subMenuElement.id||(q.subMenuElement.id=a.jqx.utilities.createId()),a.jqx.aria(a(q.element),"aria-owns",q.subMenuElement.id)))}}for(var t=0;t<d.length;t++){var u=d[t];if(this.itemMapping["id"+u.id]){var q=this.itemMapping["id"+u.id].item;if(!q)continue;q.prevItem=null,q.nextItem=null,t>0&&this.itemMapping["id"+d[t-1].id]&&(q.prevItem=this.itemMapping["id"+d[t-1].id].item),t<d.length-1&&this.itemMapping["id"+d[t+1].id]&&(q.nextItem=this.itemMapping["id"+d[t+1].id].item)}}}},destroy:function(){var b=this;a.jqx.utilities.resize(b.host,null,!0);var c=b.host.closest("div.jqx-menu-wrapper");b.removeHandler(c,"keydown"),c.remove(),b.removeHandler(a("#menuWrapper"+b.element.id),"keydown"),a("#menuWrapper"+b.element.id).remove(),b.removeHandler(b.host,"keydown"),b.removeHandler(b.host,"focus"),b.removeHandler(b.host,"blur"),b.removeHandler(a(document),"mousedown.menu"+b.element.id,b._closeAfterClick),b.removeHandler(a(document),"mouseup.menu"+b.element.id,b._closeAfterClick),b.removeHandler(a(document),"contextmenu."+b.element.id),b.removeHandler(b.host,"contextmenu."+b.element.id),a.data(document.body,"jqxMenuOldHost"+b.element.id,null),b.isTouchDevice()&&b.removeHandler(a(document),a.jqx.mobile.getTouchEventName("touchstart")+".menu"+b.element.id,b._closeAfterClick,this),a(window).off&&a(window).off("resize.menu"+b.element.id),a.each(b.items,function(){var c=this,d=a(c.element);b.removeHandler(d,"click"),b.removeHandler(d,"selectstart"),b.removeHandler(d,"mouseenter"),b.removeHandler(d,"mouseleave"),b.removeHandler(d,"mousedown"),b.removeHandler(d,"mouseleave");var e=a(c.subMenuElement),f=e.closest("div.jqx-menu-popup");f.remove(),delete this.subMenuElement,delete this.element}),a.data(document.body,"menuel",null),delete b.menuElements,b.items=new Array,delete b.items;var d=a.data(b.element,"jqxMenu");d&&delete d.instance,b.host.removeClass(),b.host.remove(),delete b.host,delete b.element},_raiseEvent:function(b,c){void 0==c&&(c={owner:null});var d=this.events[b];args=c,args.owner=this;var e=new a.Event(d);"2"==b&&(args=c.item,args.owner=this,args.clickType=c.type,a.extend(e,c.event),e.type="itemclick"),e.owner=this,e.args=args;var f=this.host.trigger(e);return f},propertiesChangedHandler:function(b,c,d){if(d.width&&d.height&&2==Object.keys(d).length&&(b._setSize(),"popup"===b.mode)){var e=this.host.closest("div.jqx-menu-wrapper");e[c](d);var f=this.host[0].id;a("#"+f)[c](d)}},propertyChangedHandler:function(b,c,d,e){if(void 0!=this.isInitialized&&0!=this.isInitialized&&!(b.batchUpdate&&b.batchUpdate.width&&b.batchUpdate.height&&2==Object.keys(b.batchUpdate).length)&&("disabled"==c&&(b.disabled?(b.host.addClass(b.toThemeProperty("jqx-fill-state-disabled")),b.host.addClass(b.toThemeProperty("jqx-menu-disabled"))):(b.host.removeClass(b.toThemeProperty("jqx-fill-state-disabled")),b.host.removeClass(b.toThemeProperty("jqx-menu-disabled")))),e!=d))if("touchMode"==c&&(this._isTouchDevice=null,b._render(e,d)),"width"!==c&&"height"!==c){if("source"==c&&null!=b.source){var f=b.loadItems(b.source);b.element.innerHTML=f;var g=b.host.find("ul:first");g.length>0&&(b.refresh(),b._createMenu(g[0]),b._render())}"autoCloseOnClick"==c?0==e?b.removeHandler(a(document),"mousedown.menu"+this.element.id,b._closeAll):b.addHandler(a(document),"mousedown.menu"+this.element.id,b,b._closeAll):"mode"==c||"width"==c||"height"==c||"showTopLevelArrows"==c?(b.refresh(),"mode"==c?b._render(e,d):b._applyOrientation()):"theme"==c&&a.jqx.utilities.setTheme(d,e,b.host)}else if(b._setSize(),"popup"===b.mode){var h=this.host.closest("div.jqx-menu-wrapper");h[c](e);var i=this.host[0].id;a("#"+i)[c](e)}}})}(jqxBaseFramework),function(a){a.jqx._jqxMenu.jqxMenuItem=function(a,b,c){var d={id:a,parentId:b,parentItem:null,anchor:null,type:c,disabled:!1,level:0,isOpen:!1,hasItems:!1,element:null,subMenuElement:null,arrow:null,openHorizontalDirection:"right",openVerticalDirection:"down",closeOnClick:!0};return d}}(jqxBaseFramework);
6 8
7 (function(a){a.jqx.jqxWidget("jqxMenu","",{});a.extend(a.jqx._jqxMenu.prototype,{defineInstance:function(){var b={items:new Array(),mode:"horizontal",width:null,height:null,minimizeWidth:"auto",easing:"easeInOutSine",animationShowDuration:200,animationHideDuration:200,autoCloseInterval:0,animationHideDelay:100,animationShowDelay:100,menuElements:new Array(),autoSizeMainItems:false,autoCloseOnClick:true,autoCloseOnMouseLeave:true,enableRoundedCorners:true,disabled:false,autoOpenPopup:true,enableHover:true,autoOpen:true,autoGenerate:true,clickToOpen:false,showTopLevelArrows:false,touchMode:"auto",source:null,popupZIndex:17000,rtl:false,keyboardNavigation:false,lockFocus:false,title:"",events:["shown","closed","itemclick","initialized"]};a.extend(true,this,b);return b},createInstance:function(c){var b=this;this.host.attr("role","menubar");a.jqx.utilities.resize(this.host,function(){b.refresh()},false,this.mode!="popup");if(this.minimizeWidth!="auto"&&this.minimizeWidth!=null&&this.width&&this.width.toString().indexOf("%")==-1){a(window).resize(function(){b.refresh()})}this.host.css("outline","none");if(this.source){if(this.source!=null){var d=this.loadItems(this.source);this.element.innerHTML=d}}this._tmpHTML=this.element.innerHTML;if(this.element.innerHTML.indexOf("UL")){var e=this.host.find("ul:first");if(e.length>0){this._createMenu(e[0])}}this.host.data("autoclose",{});this._render();this.setSize();if(a.jqx.browser.msie&&a.jqx.browser.version<8){this.host.attr("hideFocus",true)}},focus:function(){try{this.host.focus();if(this.mode==="popup"){var c=this.host.closest("div.jqx-menu-wrapper");c.focus()}if(this.keyboardNavigation){if(!this.activeItem){a(this.items[0].element).addClass(this.toThemeProperty("jqx-fill-state-focus"));this.activeItem=this.items[0]}}}catch(b){}},loadItems:function(c,e){if(c==null){return}if(c.length==0){return""}var b=this;this.items=new Array();var d="<ul>";if(e){d='<ul style="width:'+e+';">'}a.map(c,function(f){if(f==undefined){return null}d+=b._parseItem(f)});d+="</ul>";return d},_parseItem:function(f){var c="";if(f==undefined){return null}var b=f.label;if(!f.label&&f.html){b=f.html}if(!b){b="Item"}if(typeof f==="string"){b=f}var e=false;if(f.selected!=undefined&&f.selected){e=true}var d=false;if(f.disabled!=undefined&&f.disabled){d=true}c+="<li";if(d){c+=' item-disabled="true" '}if(f.label&&!f.html){c+=' item-label="'+b+'" '}if(f.value!=null){c+=' item-value="'+f.value+'" '}if(f.id!=undefined){c+=' id="'+f.id+'" '}c+=">"+b;if(f.items){if(f.subMenuWidth){c+=this.loadItems(f.items,f.subMenuWidth)}else{c+=this.loadItems(f.items)}}c+="</li>";return c},setSize:function(){if(this.width!=null&&this.width.toString().indexOf("%")!=-1){this.host.width(this.width)}else{if(this.width!=null&&this.width.toString().indexOf("px")!=-1){this.host.width(this.width)}else{if(this.width!=undefined&&!isNaN(this.width)){this.host.width(this.width)}}}if(this.height!=null&&this.height.toString().indexOf("%")!=-1){this.host.height(this.height)}else{if(this.height!=null&&this.height.toString().indexOf("px")!=-1){this.host.height(this.height)}else{if(this.height!=undefined&&!isNaN(this.height)){this.host.height(this.height)}}}if(this.height===null){this.host.height("auto")}var g=this;if(this.minimizeWidth!=null&&this.mode!="popup"){var f=a(window).width();if(!a.jqx.response){var e=false;if(navigator.userAgent.match(/Windows|Linux|MacOS/)){var b=navigator.userAgent.indexOf("Windows Phone")>=0||navigator.userAgent.indexOf("WPDesktop")>=0||navigator.userAgent.indexOf("IEMobile")>=0||navigator.userAgent.indexOf("ZuneWP7")>=0;if(!b){e=true}}var c=this.minimizeWidth;if(e&&this.minimizeWidth=="auto"){return}}if(this.minimizeWidth=="auto"&&a.jqx.response){var d=new a.jqx.response();if(d.device.type=="Phone"||d.device.type=="Tablet"){if(!this.minimized){this.minimize()}}}else{if((f<c)&&!this.minimized){this.minimize()}else{if(this.minimized&&f>=c){this.restore()}}}}},minimize:function(){if(this.minimized){return}var e=this;this.host.addClass(this.toThemeProperty("jqx-menu-minimized"));this.minimized=true;this._tmpMode=this.mode;this.mode="simple";var h=this.host.closest("div.jqx-menu-wrapper");h.remove();a("#menuWrapper"+this.element.id).remove();a.each(this.items,function(){var k=this;var j=a(k.element);var i=a(k.subMenuElement);var l=i.closest("div.jqx-menu-popup");l.remove()});if(this.source){var d=this.loadItems(this.source);this.element.innerHTML=d;this._tmpHTML=this.element.innerHTML}this.element.innerHTML=this._tmpHTML;if(this.element.innerHTML.indexOf("UL")){var g=this.host.find("ul:first");if(g.length>0){this._createMenu(g[0])}}this._render();var c=this.host.find("ul:first");c.wrap('<div class="jqx-menu-wrapper" style="z-index:'+this.popupZIndex+'; padding: 0px; display: none; margin: 0px; height: auto; width: auto; position: absolute; top: 0; left: 0; display: block; visibility: visible;"></div>');var h=c.closest("div.jqx-menu-wrapper");h[0].id="menuWrapper"+this.element.id;h.detach();h.appendTo(a(document.body));h.addClass(this.toThemeProperty("jqx-widget"));h.addClass(this.toThemeProperty("jqx-menu"));h.addClass(this.toThemeProperty("jqx-menu-minimized"));h.addClass(this.toThemeProperty("jqx-widget-header"));c.children().hide();h.hide();h.find("ul").addClass(this.toThemeProperty("jqx-menu-ul-minimized"));this.minimizedItem=a("<div></div>");this.minimizedItem.addClass(this.toThemeProperty("jqx-item"));this.minimizedItem.addClass(this.toThemeProperty("jqx-menu-item-top"));this.addHandler(h,"keydown",function(i){return e.handleKeyDown(i)});this.minimizedItem.addClass(this.toThemeProperty("jqx-menu-minimized-button"));this.minimizedItem.prependTo(this.host);this.titleElement=a("<div>"+this.title+"</div>");this.titleElement.addClass(this.toThemeProperty("jqx-item"));this.titleElement.addClass(this.toThemeProperty("jqx-menu-title"));this.titleElement.prependTo(this.host);a("<div style='clear:both;'></div>").insertAfter(this.minimizedItem);e.minimizedHidden=true;var b=function(j){e.minimizedHidden=true;e.minimizedItem.show();var i=false;if(e.minimizedItem.css("float")=="right"){i=true}h.animate({left:!i?-h.outerWidth():e.host.coord().left+e.host.width()+h.width(),opacity:0},e.animationHideDuration,function(){h.find("ul:first").children().hide();h.hide()})};var f=function(k){if(e.minimizedHidden){h.find("ul:first").children().show();e.minimizedHidden=false;h.show();h.css("opacity",0);h.css("left",-h.outerWidth());var j=false;var i=h.width();if(e.minimizedItem.css("float")=="right"){h.css("left",e.host.coord().left+e.host.width()+i);j=true}h.css("top",e.host.coord().top+e.host.height());h.animate({left:!j?e.host.coord().left:e.host.coord().left+e.host.width()-i,opacity:0.95},e.animationShowDuration,function(){})}else{b(k)}e._raiseEvent("2",{item:e.minimizedItem[0],event:k});e.setSize()};this.addHandler(a(window),"orientationchange.jqxmenu"+this.element.id,function(i){setTimeout(function(){if(!e.minimizedHidden){var j=h.width();var k=false;var j=h.width();if(e.minimizedItem.css("float")=="right"){k=true}h.css("top",e.host.coord().top+e.host.height());h.css({left:!k?e.host.coord().left:e.host.coord().left+e.host.width()-j})}},25)});this.addHandler(this.minimizedItem,"click",function(i){f(i)})},restore:function(){if(!this.minimized){return}this.host.find("ul").removeClass(this.toThemeProperty("jqx-menu-ul-minimized"));this.host.removeClass(this.toThemeProperty("jqx-menu-minimized"));this.minimized=false;this.mode=this._tmpMode;if(this.minimizedItem){this.minimizedItem.remove()}var d=a("#menuWrapper"+this.element.id);d.remove();if(this.source){var b=this.loadItems(this.source);this.element.innerHTML=b;this._tmpHTML=b}this.element.innerHTML=this._tmpHTML;if(this.element.innerHTML.indexOf("UL")){var c=this.host.find("ul:first");if(c.length>0){this._createMenu(c[0])}}this.setSize();this._render()},isTouchDevice:function(){if(this._isTouchDevice!=undefined){return this._isTouchDevice}var b=a.jqx.mobile.isTouchDevice();if(this.touchMode==true){b=true}else{if(this.touchMode==false){b=false}}if(b){this.host.addClass(this.toThemeProperty("jqx-touch"));a(".jqx-menu-item").addClass(this.toThemeProperty("jqx-touch"))}this._isTouchDevice=b;return b},refresh:function(b){if(!b){this.setSize()}},resize:function(c,b){this.width=c;this.height=b;this.refresh()},_closeAll:function(f){var d=f!=null?f.data:this;var b=d.items;a.each(b,function(){var e=this;if(e.hasItems==true){if(e.isOpen){d._closeItem(d,e)}}});if(d.mode=="popup"){if(f!=null){var c=d._isRightClick(f);if(!c){d.close()}}}},closeItem:function(e){if(e==null){return false}var b=e;var c=document.getElementById(b);var d=this;a.each(d.items,function(){var f=this;if(f.isOpen==true&&f.element==c){d._closeItem(d,f);if(f.parentId){d.closeItem(f.parentId)}}});return true},openItem:function(e){if(e==null){return false}var b=e;var c=document.getElementById(b);var d=this;a.each(d.items,function(){var f=this;if(f.isOpen==false&&f.element==c){d._openItem(d,f);if(f.parentId){d.openItem(f.parentId)}}});return true},_getClosedSubMenuOffset:function(c){var b=a(c.subMenuElement);var f=-b.outerHeight();var e=-b.outerWidth();var d=c.level==0&&this.mode=="horizontal";if(d){e=0}else{f=0}switch(c.openVerticalDirection){case"up":case"center":f=b.outerHeight();break}switch(c.openHorizontalDirection){case this._getDir("left"):if(d){e=0}else{e=b.outerWidth()}break;case"center":if(d){e=0}else{e=b.outerWidth()}break}return{left:e,top:f}},_closeItem:function(l,o,g,c){if(l==null||o==null){return false}var j=a(o.subMenuElement);var b=o.level==0&&this.mode=="horizontal";var f=this._getClosedSubMenuOffset(o);var m=f.top;var e=f.left;var i=a(o.element);var k=j.closest("div.jqx-menu-popup");if(k!=null){var h=l.animationHideDelay;if(c==true){h=0}if(j.data("timer")&&j.data("timer").show!=null){clearTimeout(j.data("timer").show);j.data("timer").show=null}var n=function(){o.isOpen=false;if(b){j.stop().animate({top:m},l.animationHideDuration,function(){a(o.element).removeClass(l.toThemeProperty("jqx-fill-state-pressed"));a(o.element).removeClass(l.toThemeProperty("jqx-menu-item-top-selected"));a(o.element).removeClass(l.toThemeProperty("jqx-rc-b-expanded"));k.removeClass(l.toThemeProperty("jqx-rc-t-expanded"));var p=a(o.arrow);if(p.length>0&&l.showTopLevelArrows){p.removeClass();if(o.openVerticalDirection=="down"){p.addClass(l.toThemeProperty("jqx-menu-item-arrow-down"));p.addClass(l.toThemeProperty("jqx-icon-arrow-down"))}else{p.addClass(l.toThemeProperty("jqx-menu-item-arrow-up"));p.addClass(l.toThemeProperty("jqx-icon-arrow-up"))}}a.jqx.aria(a(o.element),"aria-expanded",false);k.css({display:"none"});if(l.animationHideDuration==0){j.css({top:m})}l._raiseEvent("1",o)})}else{if(!a.jqx.browser.msie){}j.stop().animate({left:e},l.animationHideDuration,function(){if(l.animationHideDuration==0){j.css({left:e})}if(o.level>0){a(o.element).removeClass(l.toThemeProperty("jqx-fill-state-pressed"));a(o.element).removeClass(l.toThemeProperty("jqx-menu-item-selected"));var p=a(o.arrow);if(p.length>0){p.removeClass();if(o.openHorizontalDirection!="left"){p.addClass(l.toThemeProperty("jqx-menu-item-arrow-"+l._getDir("right")));p.addClass(l.toThemeProperty("jqx-icon-arrow-"+l._getDir("right")))}else{p.addClass(l.toThemeProperty("jqx-menu-item-arrow-"+l._getDir("left")));p.addClass(l.toThemeProperty("jqx-icon-arrow-"+l._getDir("left")))}}}else{a(o.element).removeClass(l.toThemeProperty("jqx-fill-state-pressed"));a(o.element).removeClass(l.toThemeProperty("jqx-menu-item-top-selected"));var p=a(o.arrow);if(p.length>0){p.removeClass();if(o.openHorizontalDirection!="left"){p.addClass(l.toThemeProperty("jqx-menu-item-arrow-top-"+l._getDir("right")));p.addClass(l.toThemeProperty("jqx-icon-arrow-"+l._getDir("right")))}else{p.addClass(l.toThemeProperty("jqx-menu-item-arrow-top-"+l._getDir("left")));p.addClass(l.toThemeProperty("jqx-icon-arrow-"+l._getDir("left")))}}}a.jqx.aria(a(o.element),"aria-expanded",false);k.css({display:"none"});l._raiseEvent("1",o)})}};if(h>0){if(j.data("timer")){j.data("timer").hide=setTimeout(function(){n()},h)}}else{n()}if(g!=undefined&&g){var d=j.children();a.each(d,function(){if(l.menuElements[this.id]&&l.menuElements[this.id].isOpen){var p=a(l.menuElements[this.id].subMenuElement);l._closeItem(l,l.menuElements[this.id],true,true)}})}}},getSubItems:function(i,h){if(i==null){return false}var g=this;var c=new Array();if(h!=null){a.extend(c,h)}var d=i;var f=this.menuElements[d];var b=a(f.subMenuElement);var e=b.find(".jqx-menu-item");a.each(e,function(){c[this.id]=g.menuElements[this.id];var j=g.getSubItems(this.id,c);a.extend(c,j)});return c},disable:function(g,d){if(g==null){return}var c=g;var f=this;if(this.menuElements[c]){var e=this.menuElements[c];e.disabled=d;var b=a(e.element);e.element.disabled=d;a.each(b.children(),function(){this.disabled=d});if(d){b.addClass(f.toThemeProperty("jqx-menu-item-disabled"));b.addClass(f.toThemeProperty("jqx-fill-state-disabled"))}else{b.removeClass(f.toThemeProperty("jqx-menu-item-disabled"));b.removeClass(f.toThemeProperty("jqx-fill-state-disabled"))}}},_setItemProperty:function(g,c,f){if(g==null){return}var b=g;var e=this;if(this.menuElements[b]){var d=this.menuElements[b];if(d[c]){d[c]=f}}},setItemOpenDirection:function(d,c,e){if(d==null){return}var j=d;var g=this;var f=a.jqx.browser.msie&&a.jqx.browser.version<8;if(this.menuElements[j]){var i=this.menuElements[j];if(c!=null){i.openHorizontalDirection=c;if(i.hasItems&&i.level>0){var h=a(i.element);if(h!=undefined){var b=a(i.arrow);if(i.arrow==null){b=a('<span id="arrow'+h[0].id+'"></span>');if(!f){b.prependTo(h)}else{b.appendTo(h)}i.arrow=b[0]}b.removeClass();if(i.openHorizontalDirection=="left"){b.addClass(g.toThemeProperty("jqx-menu-item-arrow-"+g._getDir("left")));b.addClass(g.toThemeProperty("jqx-icon-arrow-"+g._getDir("left")))}else{b.addClass(g.toThemeProperty("jqx-menu-item-arrow-"+g._getDir("right")));b.addClass(g.toThemeProperty("jqx-icon-arrow-"+g._getDir("right")))}b.css("visibility","visible");if(!f){b.css("display","block");b.css("float","right")}else{b.css("display","inline-block");b.css("float","none")}}}}if(e!=null){i.openVerticalDirection=e;var b=a(i.arrow);var h=a(i.element);if(!g.showTopLevelArrows){return}if(h!=undefined){if(i.arrow==null){b=a('<span id="arrow'+h[0].id+'"></span>');if(!f){b.prependTo(h)}else{b.appendTo(h)}i.arrow=b[0]}b.removeClass();if(i.openVerticalDirection=="down"){b.addClass(g.toThemeProperty("jqx-menu-item-arrow-down"));b.addClass(g.toThemeProperty("jqx-icon-arrow-down"))}else{b.addClass(g.toThemeProperty("jqx-menu-item-arrow-up"));b.addClass(g.toThemeProperty("jqx-icon-arrow-up"))}b.css("visibility","visible");if(!f){b.css("display","block");b.css("float","right")}else{b.css("display","inline-block");b.css("float","none")}}}}},_getSiblings:function(d){var e=new Array();var b=0;for(var c=0;c<this.items.length;c++){if(this.items[c]==d){continue}if(this.items[c].parentId==d.parentId&&this.items[c].hasItems){e[b++]=this.items[c]}}return e},_openItem:function(s,r,q){if(s==null||r==null){return false}if(r.isOpen){return false}if(r.disabled){return false}if(s.disabled){return false}var l=s.popupZIndex;if(q!=undefined){l=q}var e=s.animationHideDuration;s.animationHideDuration=0;s._closeItem(s,r,true,true);s.animationHideDuration=e;a(r.element).focus();var f=[5,5];var t=a(r.subMenuElement);if(t!=null){t.stop()}if(t.data("timer")&&t.data("timer").hide!=null){clearTimeout(t.data("timer").hide)}var o=t.closest("div.jqx-menu-popup");var h=a(r.element);var i=r.level==0?this._getOffset(r.element):h.position();if(r.level>0&&this.hasTransform){var p=parseInt(h.coord().top)-parseInt(this._getOffset(r.element).top);i.top+=p}if(r.level==0&&this.mode=="popup"){i=h.coord()}var j=r.level==0&&this.mode=="horizontal";var b=j?i.left:this.menuElements[r.parentId]!=null&&this.menuElements[r.parentId].subMenuElement!=null?parseInt(a(a(this.menuElements[r.parentId].subMenuElement).closest("div.jqx-menu-popup")).outerWidth())-f[0]:parseInt(t.outerWidth());o.css({visibility:"visible",display:"block",left:b,top:j?i.top+h.outerHeight():i.top,zIndex:l});t.css("display","block");if(this.mode!="horizontal"&&r.level==0){var d=this._getOffset(this.element);o.css("left",-1+d.left+this.host.outerWidth());t.css("left",-t.outerWidth())}else{var c=this._getClosedSubMenuOffset(r);t.css("left",c.left);t.css("top",c.top)}o.css({height:parseInt(t.outerHeight())+parseInt(f[1])+"px"});var n=0;var g=0;switch(r.openVerticalDirection){case"up":if(j){t.css("top",t.outerHeight());n=f[1];var k=parseInt(t.parent().css("padding-bottom"));if(isNaN(k)){k=0}if(k>0){o.addClass(this.toThemeProperty("jqx-menu-popup-clear"))}t.css("top",t.outerHeight()-k);o.css({display:"block",top:i.top-o.outerHeight(),zIndex:l})}else{n=f[1];t.css("top",t.outerHeight());o.css({display:"block",top:i.top-o.outerHeight()+f[1]+h.outerHeight(),zIndex:l})}break;case"center":if(j){t.css("top",0);o.css({display:"block",top:i.top-o.outerHeight()/2+f[1],zIndex:l})}else{t.css("top",0);o.css({display:"block",top:i.top+h.outerHeight()/2-o.outerHeight()/2+f[1],zIndex:l})}break}switch(r.openHorizontalDirection){case this._getDir("left"):if(j){o.css({left:i.left-(o.outerWidth()-h.outerWidth()-f[0])})}else{g=0;t.css("left",o.outerWidth());o.css({left:i.left-(o.outerWidth())+2*r.level})}break;case"center":if(j){o.css({left:i.left-(o.outerWidth()/2-h.outerWidth()/2-f[0]/2)})}else{o.css({left:i.left-(o.outerWidth()/2-h.outerWidth()/2-f[0]/2)});t.css("left",o.outerWidth())}break}if(j){if(parseInt(t.css("top"))==n){r.isOpen=true;return}}else{if(parseInt(t.css("left"))==g){r.isOpen==true;return}}a.each(s._getSiblings(r),function(){s._closeItem(s,this,true,true)});var m=a.data(s.element,"animationHideDelay");s.animationHideDelay=m;if(this.autoCloseInterval>0){if(this.host.data("autoclose")!=null&&this.host.data("autoclose").close!=null){clearTimeout(this.host.data("autoclose").close)}if(this.host.data("autoclose")!=null){this.host.data("autoclose").close=setTimeout(function(){s._closeAll()},this.autoCloseInterval)}}if(t.data("timer")){t.data("timer").show=setTimeout(function(){if(o!=null){if(j){t.stop();t.css("left",g);if(!a.jqx.browser.msie){}h.addClass(s.toThemeProperty("jqx-fill-state-pressed"));h.addClass(s.toThemeProperty("jqx-menu-item-top-selected"));if(r.openVerticalDirection=="down"){a(r.element).addClass(s.toThemeProperty("jqx-rc-b-expanded"));o.addClass(s.toThemeProperty("jqx-rc-t-expanded"))}else{a(r.element).addClass(s.toThemeProperty("jqx-rc-t-expanded"));o.addClass(s.toThemeProperty("jqx-rc-b-expanded"))}var u=a(r.arrow);if(u.length>0&&s.showTopLevelArrows){u.removeClass();if(r.openVerticalDirection=="down"){u.addClass(s.toThemeProperty("jqx-menu-item-arrow-down-selected"));u.addClass(s.toThemeProperty("jqx-icon-arrow-down"))}else{u.addClass(s.toThemeProperty("jqx-menu-item-arrow-up-selected"));u.addClass(s.toThemeProperty("jqx-icon-arrow-up"))}}if(s.animationShowDuration==0){t.css({top:n});r.isOpen=true;s._raiseEvent("0",r);a.jqx.aria(a(r.element),"aria-expanded",true)}else{t.animate({top:n},s.animationShowDuration,s.easing,function(){r.isOpen=true;a.jqx.aria(a(r.element),"aria-expanded",true);s._raiseEvent("0",r)})}}else{t.stop();t.css("top",n);if(!a.jqx.browser.msie){}if(r.level>0){h.addClass(s.toThemeProperty("jqx-fill-state-pressed"));h.addClass(s.toThemeProperty("jqx-menu-item-selected"));var u=a(r.arrow);if(u.length>0){u.removeClass();if(r.openHorizontalDirection!="left"){u.addClass(s.toThemeProperty("jqx-menu-item-arrow-"+s._getDir("right")+"-selected"));u.addClass(s.toThemeProperty("jqx-icon-arrow-"+s._getDir("right")))}else{u.addClass(s.toThemeProperty("jqx-menu-item-arrow-"+s._getDir("left")+"-selected"));u.addClass(s.toThemeProperty("jqx-icon-arrow-"+s._getDir("left")))}}}else{h.addClass(s.toThemeProperty("jqx-fill-state-pressed"));h.addClass(s.toThemeProperty("jqx-menu-item-top-selected"));var u=a(r.arrow);if(u.length>0){u.removeClass();if(r.openHorizontalDirection!="left"){u.addClass(s.toThemeProperty("jqx-menu-item-arrow-"+s._getDir("right")+"-selected"));u.addClass(s.toThemeProperty("jqx-icon-arrow-"+s._getDir("right")))}else{u.addClass(s.toThemeProperty("jqx-menu-item-arrow-"+s._getDir("left")+"-selected"));u.addClass(s.toThemeProperty("jqx-icon-arrow-"+s._getDir("left")))}}}if(!a.jqx.browser.msie){}if(s.animationShowDuration==0){t.css({left:g});s._raiseEvent("0",r);r.isOpen=true;a.jqx.aria(a(r.element),"aria-expanded",true)}else{t.animate({left:g},s.animationShowDuration,s.easing,function(){s._raiseEvent("0",r);r.isOpen=true;a.jqx.aria(a(r.element),"aria-expanded",true)})}}}},this.animationShowDelay)}},_getDir:function(b){switch(b){case"left":return !this.rtl?"left":"right";case"right":return this.rtl?"left":"right"}return"left"},_applyOrientation:function(i,d){var g=this;var f=0;g.host.removeClass(g.toThemeProperty("jqx-menu-horizontal"));g.host.removeClass(g.toThemeProperty("jqx-menu-vertical"));g.host.removeClass(g.toThemeProperty("jqx-menu"));g.host.removeClass(g.toThemeProperty("jqx-widget"));g.host.addClass(g.toThemeProperty("jqx-widget"));g.host.addClass(g.toThemeProperty("jqx-menu"));if(i!=undefined&&d!=undefined&&d=="popup"){if(g.host.parent().length>0&&g.host.parent().parent().length>0&&g.host.parent().parent()[0]==document.body){var h=a.data(document.body,"jqxMenuOldHost"+g.element.id);if(h!=null){var e=g.host.closest("div.jqx-menu-wrapper");e.remove();e.appendTo(h);g.host.css("display","block");g.host.css("visibility","visible");e.css("display","block");e.css("visibility","visible")}}}else{if(i==undefined&&d==undefined){a.data(document.body,"jqxMenuOldHost"+g.element.id,g.host.parent()[0])}}if(g.autoOpenPopup){if(g.mode=="popup"){g.addHandler(a(document),"contextmenu."+g.element.id,function(j){return false});g.addHandler(a(document),"mousedown.menu"+g.element.id,function(j){g._openContextMenu(j)})}else{g.removeHandler(a(document),"contextmenu."+g.element.id);g.removeHandler(a(document),"mousedown.menu"+g.element.id)}}else{g.removeHandler(a(document),"contextmenu."+g.element.id);g.removeHandler(a(document),"mousedown.menu"+g.element.id)}if(g.rtl){g.host.addClass(g.toThemeProperty("jqx-rtl"))}switch(g.mode){case"horizontal":g.host.addClass(g.toThemeProperty("jqx-widget-header"));g.host.addClass(g.toThemeProperty("jqx-menu-horizontal"));a.each(g.items,function(){var l=this;$element=a(l.element);var k=a(l.arrow);k.removeClass();if(l.hasItems&&l.level>0){var k=a('<span style="border: none; background-color: transparent;" id="arrow'+$element[0].id+'"></span>');k.prependTo($element);k.css("float",g._getDir("right"));k.addClass(g.toThemeProperty("jqx-menu-item-arrow-"+g._getDir("right")));k.addClass(g.toThemeProperty("jqx-icon-arrow-"+g._getDir("right")));l.arrow=k[0]}if(l.level==0){a(l.element).css("float",g._getDir("left"));if(!l.ignoretheme&&l.hasItems&&g.showTopLevelArrows){var k=a('<span style="border: none; background-color: transparent;" id="arrow'+$element[0].id+'"></span>');var j=a.jqx.browser.msie&&a.jqx.browser.version<8;if(l.arrow==null){if(!j){k.prependTo($element)}else{k.appendTo($element)}}else{k=a(l.arrow)}if(l.openVerticalDirection=="down"){k.addClass(g.toThemeProperty("jqx-menu-item-arrow-down"));k.addClass(g.toThemeProperty("jqx-icon-arrow-down"))}else{k.addClass(g.toThemeProperty("jqx-menu-item-arrow-up"));k.addClass(g.toThemeProperty("jqx-icon-arrow-up"))}k.css("visibility","visible");if(!j){k.css("display","block");k.css("float","right")}else{k.css("display","inline-block")}l.arrow=k[0]}else{if(!l.ignoretheme&&l.hasItems&&!g.showTopLevelArrows){if(l.arrow!=null){var k=a(l.arrow);k.remove();l.arrow=null}}}f=Math.max(f,$element.height())}});break;case"vertical":case"popup":case"simple":g.host.addClass(g.toThemeProperty("jqx-menu-vertical"));a.each(g.items,function(){var k=this;$element=a(k.element);if(k.hasItems&&!k.ignoretheme){if(k.arrow){a(k.arrow).remove()}if(g.mode=="simple"){return true}var j=a('<span style="border: none; background-color: transparent;" id="arrow'+$element[0].id+'"></span>');j.prependTo($element);j.css("float","right");if(k.level==0){j.addClass(g.toThemeProperty("jqx-menu-item-arrow-top-"+g._getDir("right")));j.addClass(g.toThemeProperty("jqx-icon-arrow-"+g._getDir("right")))}else{j.addClass(g.toThemeProperty("jqx-menu-item-arrow-"+g._getDir("right")));j.addClass(g.toThemeProperty("jqx-icon-arrow-"+g._getDir("right")))}k.arrow=j[0]}$element.css("float","none")});if(g.mode=="popup"){g.host.addClass(g.toThemeProperty("jqx-widget-content"));g.host.wrap('<div tabindex=0 class="jqx-menu-wrapper" style="z-index:'+g.popupZIndex+'; border: none; background-color: transparent; padding: 0px; margin: 0px; position: absolute; top: 0; left: 0; display: block; visibility: visible;"></div>');var e=g.host.closest("div.jqx-menu-wrapper");g.host.addClass(g.toThemeProperty("jqx-popup"));e[0].id="menuWrapper"+g.element.id;e.appendTo(a(document.body));g.addHandler(e,"keydown",function(j){return g.handleKeyDown(j)})}else{g.host.addClass(g.toThemeProperty("jqx-widget-header"))}if(g.mode=="popup"){var b=g.host.height();g.host.css("position","absolute");g.host.css("top","0");g.host.css("left","0");if(g.mode!="simple"){g.host.height(b);g.host.css("display","none")}}break}var c=g.isTouchDevice();if(g.autoCloseOnClick){g.removeHandler(a(document),"mousedown.menu"+g.element.id,g._closeAfterClick);g.addHandler(a(document),"mousedown.menu"+g.element.id,g._closeAfterClick,g);if(c){g.removeHandler(a(document),a.jqx.mobile.getTouchEventName("touchstart")+".menu"+g.element.id,g._closeAfterClick,g);g.addHandler(a(document),a.jqx.mobile.getTouchEventName("touchstart")+".menu"+g.element.id,g._closeAfterClick,g)}}},_getBodyOffset:function(){var c=0;var b=0;if(a("body").css("border-top-width")!="0px"){c=parseInt(a("body").css("border-top-width"));if(isNaN(c)){c=0}}if(a("body").css("border-left-width")!="0px"){b=parseInt(a("body").css("border-left-width"));if(isNaN(b)){b=0}}return{left:b,top:c}},_getOffset:function(c){var e=a.jqx.mobile.isSafariMobileBrowser();var h=a(c).coord(true);var g=h.top;var f=h.left;if(a("body").css("border-top-width")!="0px"){g=parseInt(g)+this._getBodyOffset().top}if(a("body").css("border-left-width")!="0px"){f=parseInt(f)+this._getBodyOffset().left}var d=a.jqx.mobile.isWindowsPhone();if(this.hasTransform||(e!=null&&e)||d){var b={left:a.jqx.mobile.getLeftPos(c),top:a.jqx.mobile.getTopPos(c)};return b}else{return{left:f,top:g}}},_isRightClick:function(c){var b;if(!c){var c=window.event}if(c.which){b=(c.which==3)}else{if(c.button){b=(c.button==2)}}return b},_openContextMenu:function(d){var c=this;var b=c._isRightClick(d);if(b){c.open(parseInt(d.clientX)+5,parseInt(d.clientY)+5)}},close:function(){var c=this;var d=a.data(this.element,"contextMenuOpened"+this.element.id);if(d){var b=this.host;a.each(c.items,function(){var e=this;if(e.hasItems){c._closeItem(c,e)}});a.each(c.items,function(){var e=this;if(e.isOpen==true){$submenu=a(e.subMenuElement);var f=$submenu.closest("div.jqx-menu-popup");f.hide(this.animationHideDuration)}});this.host.hide(this.animationHideDuration);a.data(c.element,"contextMenuOpened"+this.element.id,false);c._raiseEvent("1",c)}},open:function(e,d){if(this.mode=="popup"){var c=0;if(this.host.css("display")=="block"){this.close();c=this.animationHideDuration}var b=this;if(e==undefined||e==null){e=0}if(d==undefined||d==null){d=0}setTimeout(function(){b.host.show(b.animationShowDuration);b.host.css("visibility","visible");a.data(b.element,"contextMenuOpened"+b.element.id,true);b._raiseEvent("0",b);b.host.css("z-index",9999);if(e!=undefined&&d!=undefined){b.host.css({left:e,top:d})}},c)}},_renderHover:function(c,e,b){var d=this;if(!e.ignoretheme){this.addHandler(c,"mouseenter",function(){d.hoveredItem=e;if(!e.disabled&&!e.separator&&d.enableHover&&!d.disabled){if(e.level>0){c.addClass(d.toThemeProperty("jqx-fill-state-hover"));c.addClass(d.toThemeProperty("jqx-menu-item-hover"))}else{c.addClass(d.toThemeProperty("jqx-fill-state-hover"));c.addClass(d.toThemeProperty("jqx-menu-item-top-hover"))}}});this.addHandler(c,"mouseleave",function(){if(!e.disabled&&!e.separator&&d.enableHover&&!d.disabled){if(e.level>0){c.removeClass(d.toThemeProperty("jqx-fill-state-hover"));c.removeClass(d.toThemeProperty("jqx-menu-item-hover"))}else{c.removeClass(d.toThemeProperty("jqx-fill-state-hover"));c.removeClass(d.toThemeProperty("jqx-menu-item-top-hover"))}}})}},_closeAfterClick:function(c){var b=c!=null?c.data:this;var d=false;if(b.autoCloseOnClick){a.each(a(c.target).parents(),function(){if(this.className.indexOf){if(this.className.indexOf("jqx-menu")!=-1){d=true;return false}}});if(!d){c.data=b;b._closeAll(c)}}},_autoSizeHorizontalMenuItems:function(){var c=this;if(c.autoSizeMainItems&&this.mode=="horizontal"){var b=this.maxHeight;if(parseInt(b)>parseInt(this.host.height())){b=parseInt(this.host.height())}b=parseInt(this.host.height());a.each(this.items,function(){var l=this;$element=a(l.element);if(l.level==0&&b>0){var d=$element.children().length>0?parseInt($element.children().height()):$element.height();var g=c.host.find("ul:first");var h=parseInt(g.css("padding-top"));var m=parseInt(g.css("margin-top"));var j=b-2*(m+h);var i=parseInt(j)/2-d/2;var e=parseInt(i);var k=parseInt(i);$element.css("padding-top",e);$element.css("padding-bottom",k);if(parseInt($element.outerHeight())>j){var f=1;$element.css("padding-top",e-f);e=e-f}}})}a.each(this.items,function(){var f=this;$element=a(f.element);if(f.hasItems&&f.level>0){if(f.arrow){var e=a(f.arrow);var d=a(f.element).height();if(d>15){e.css("margin-top",(d-15)/2)}}}})},_nextVisibleItem:function(c,d){if(c==null||c==undefined){return null}var b=c;while(b!=null){b=b.nextItem;if(this._isVisible(b)&&!b.disabled&&b.type!=="separator"){if(this.minimized){return b}if(d!=undefined){if(b&&b.level!=d){continue}}return b}}return null},_prevVisibleItem:function(c,d){if(c==null||c==undefined){return null}var b=c;while(b!=null){b=b.prevItem;if(this._isVisible(b)&&!b.disabled&&b.type!=="separator"){if(this.minimized){return b}if(d!=undefined){if(b&&b.level!=d){continue}}return b}}return null},_parentItem:function(d){if(d==null||d==undefined){return null}var c=d.parentElement;if(!c){return null}var b=null;a.each(this.items,function(){if(this.element==c){b=this;return false}});return b},_isElementVisible:function(b){if(b==null){return false}if(a(b).css("display")!="none"&&a(b).css("visibility")!="hidden"){return true}return false},_isVisible:function(c){if(c==null||c==undefined){return false}if(!this._isElementVisible(c.element)){return false}var b=this._parentItem(c);if(b==null){return true}if(this.minimized){return true}if(b!=null){if(!this._isElementVisible(b.element)){return false}if(b.isOpen||this.minimized){while(b!=null){b=this._parentItem(b);if(b!=null&&!this._isElementVisible(b.element)){return false}if(b!=null&&!b.isOpen){return false}}}else{return false}}return true},_render:function(f,g){if(this.disabled){this.host.addClass(this.toThemeProperty("jqx-fill-state-disabled"));this.host.addClass(this.toThemeProperty("jqx-menu-disabled"))}if(this.host.attr("tabindex")==undefined){this.host.attr("tabindex",0)}var i=this.popupZIndex;var d=[5,5];var h=this;a.data(h.element,"animationHideDelay",h.animationHideDelay);var e=this.isTouchDevice();var c=e&&(a.jqx.mobile.isWindowsPhone()||navigator.userAgent.indexOf("Touch")>=0);var j=false;if(navigator.platform.toLowerCase().indexOf("win")!=-1){if(navigator.userAgent.indexOf("Windows Phone")>=0||navigator.userAgent.indexOf("WPDesktop")>=0||navigator.userAgent.indexOf("IEMobile")>=0||navigator.userAgent.indexOf("ZuneWP7")>=0){this.touchDevice=true}else{if(navigator.userAgent.indexOf("Touch")>=0){var b=("MSPointerDown" in window);if(b||a.jqx.mobile.isWindowsPhone()||navigator.userAgent.indexOf("ARM")>=0){j=true;c=true;h.clickToOpen=true;h.autoCloseOnClick=false;h.enableHover=false}}}}a.data(document.body,"menuel",this);this.hasTransform=a.jqx.utilities.hasTransform(this.host);this._applyOrientation(f,g);this.removeHandler(this.host,"blur");this.removeHandler(this.host,"focus");this.addHandler(this.host,"blur",function(k){if(h.keyboardNavigation){if(h.activeItem){a(h.activeItem.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=null}}});this.addHandler(this.host,"focus",function(k){if(h.keyboardNavigation){if(!h.activeItem){if(h.hoveredItem){a(h.hoveredItem.element).addClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=h.hoveredItem}else{a(h.items[0].element).addClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=h.items[0]}}}});this.removeHandler(this.host,"keydown");h.handleKeyDown=function(k){if(h.keyboardNavigation){if(k.target.nodeName.toLowerCase()==="input"){return true}var q=null;var o=null;a.each(h.items,function(){var A=this;if(this.disabled){return true}if(this.element.className.indexOf("pressed")>=0){o=this}if(this.element.className.indexOf("focus")>=0){q=this;return false}});if(!q&&o){q=o}if(!q){a(h.items[0].element).addClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=h.items[0]}var t=false;if(k.keyCode==27){k.data=h;h._closeAll(k);if(q){var z=q;while(z!=null){if(z.parentItem){z=z.parentItem}else{a(h.activeItem.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=z;a(h.activeItem.element).addClass(h.toThemeProperty("jqx-fill-state-focus"));z=z.parentItem}}}t=true}if(k.keyCode==13){if(q){t=true;h._raiseEvent("2",{item:q.element,event:k});var r=q.anchor!=null?a(q.anchor):null;if(r!=null&&r.length>0){var l=r.attr("href");var u=r.attr("target");if(l!=null){if(u!=null){window.open(l,u)}else{window.location=l}}}k.preventDefault();k.stopPropagation();a(q.element).focus()}}var n=function(D){if(D==null){return new Array()}var C=new Array();var A=0;for(var B=0;B<h.items.length;B++){if(h.items[B].parentId==D.parentId){C[A++]=h.items[B]}}return C};var v="";switch(k.keyCode){case 40:v="down";break;case 38:v="up";break;case 39:v="right";break;case 37:v="left";break}if(q&&q.openHorizontalDirection==="left"&&v==="left"){v="right"}if(q&&q.openHorizontalDirection==="left"&&v==="right"){v="left"}if(q&&q.openVerticalDirection==="top"&&v==="top"){v="bottom"}if(q&&q.openVerticalDirection==="top"&&v==="bottom"){v="top"}if(h.rtl){if(v==="right"){v="left"}else{if(v==="left"){v="right"}}}if(v==="right"&&!h.minimized){if(k.altKey&&(q.level!=0&&q.hasItems||h.mode!="horizontal")){h._openItem(h,q)}else{var x=h._nextVisibleItem(q,0);var m=h._nextVisibleItem(q);var w=n(m);if(!x){x=m}if(x&&((x.parentId===q.parentId&&x.level==0&&h.mode=="horizontal")||(m.id==w[0].id&&m.level!=0))){if(m.id==w[0].id&&((q.level!=0)||(q.level==0&&h.mode!="horizontal"))){x=m}a(x.element).addClass(h.toThemeProperty("jqx-fill-state-focus"));a(q.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=x}}k.preventDefault();k.stopPropagation()}if(v==="left"&&!h.minimized){if(k.altKey&&((q.level!=0&&h.mode!=="horizontal")||(q.level>1&&h.mode==="horizontal")||(q.level==1&&q.hasItems&&h.mode==="horizontal"))){if(q.hasItems){h._closeItem(h,q)}else{if(q.parentItem){h._closeItem(h,q.parentItem);a(q.parentItem.element).addClass(h.toThemeProperty("jqx-fill-state-focus"));a(q.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=q.parentItem}}}else{var x=h._prevVisibleItem(q,0);var y=q.parentItem;if(x&&(x.parentId===q.parentId&&x.level==0&&h.mode=="horizontal")){a(x.element).addClass(h.toThemeProperty("jqx-fill-state-focus"));a(q.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=x}else{if(!(y&&y.level==0&&h.mode=="horizontal")&&y&&y.level==q.level-1){a(y.element).addClass(h.toThemeProperty("jqx-fill-state-focus"));a(q.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=y}}}k.preventDefault();k.stopPropagation()}if(v==="down"){if(k.altKey){if(q.level==0&&q.hasItems){h._openItem(h,q)}if(h.minimized){if(h.minimizedHidden){h.minimizedItem.trigger("click")}}}else{var x=h._nextVisibleItem(q,q.level);var w=n(x);if(h.minimized&&x){a(x.element).addClass(h.toThemeProperty("jqx-fill-state-focus"));a(q.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=x}else{if(x&&(x.parentId===q.parentId||(x.id==w[0].id&&h.mode=="horizontal"))){if(!(x.level==0&&h.mode=="horizontal")){a(x.element).addClass(h.toThemeProperty("jqx-fill-state-focus"));a(q.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=x}}if(h.mode==="horizontal"&&q.level===0&&q.isOpen&&q.hasItems){var x=h._nextVisibleItem(q);a(x.element).addClass(h.toThemeProperty("jqx-fill-state-focus"));a(q.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=x}}}k.preventDefault();k.stopPropagation()}else{if(v==="up"){if(k.altKey){if(q.parentItem&&q.parentItem.level==0){h._closeItem(h,q.parentItem);a(q.parentItem.element).addClass(h.toThemeProperty("jqx-fill-state-focus"));a(q.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=q.parentItem}else{if(q.parentItem===null&&q.level===0&&h.mode==="horizontal"){h._closeItem(h,q)}}if(h.minimized){if(!h.minimizedHidden){h.minimizedItem.trigger("click")}}}else{var x=h._prevVisibleItem(q,q.level);var w=n(q);if(h.minimized&&x){a(x.element).addClass(h.toThemeProperty("jqx-fill-state-focus"));a(q.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=x}else{if(x&&(x.parentId===q.parentId||(x.id==q.parentId&&x.level==0&&h.mode=="horizontal"))){if(!(x.level==0&&h.mode==="horizontal"&&q.level===0)){a(x.element).addClass(h.toThemeProperty("jqx-fill-state-focus"));a(q.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=x}}else{if(q&&q.id==w[0].id&&q.parentItem&&q.parentItem.level===0&&h.mode==="horizontal"){var x=q.parentItem;a(x.element).addClass(h.toThemeProperty("jqx-fill-state-focus"));a(q.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=x}}}}k.preventDefault();k.stopPropagation()}}if(k.keyCode==9){var x=k.shiftKey?h._prevVisibleItem(q):h._nextVisibleItem(q);if(x){a(x.element).addClass(h.toThemeProperty("jqx-fill-state-focus"));a(q.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=x;k.preventDefault();k.stopPropagation()}else{if(h.lockFocus){var w=new Array();var s=0;for(var p=0;p<h.items.length;p++){if(h.items[p]==q){continue}if(h.items[p].parentId==q.parentId){w[s++]=h.items[p]}}if(w.length>0){if(k.shiftKey){a(w[w.length-1].element).addClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=w[w.length-1]}else{a(w[0].element).addClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=w[0]}a(q.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"))}k.preventDefault();k.stopPropagation()}else{if(q){a(q.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"));h.activeItem=null}}}}}else{return true}};this.addHandler(this.host,"keydown",function(k){h.handleKeyDown(k)});if(h.enableRoundedCorners){this.host.addClass(h.toThemeProperty("jqx-rc-all"))}a.each(this.items,function(){var r=this;var n=a(r.element);n.attr("role","menuitem");if(h.enableRoundedCorners){n.addClass(h.toThemeProperty("jqx-rc-all"))}h.removeHandler(n,"click");h.addHandler(n,"click",function(w){if(r.disabled){return}if(h.disabled){return}if(h.keyboardNavigation){if(h.activeItem){a(h.activeItem.element).removeClass(h.toThemeProperty("jqx-fill-state-focus"))}h.activeItem=r;a(r.element).addClass(h.toThemeProperty("jqx-fill-state-focus"));if(h.minimized){w.stopPropagation()}}h._raiseEvent("2",{item:r.element,event:w});if(!h.autoOpen){if(r.level>0){if(h.autoCloseOnClick&&!e&&!h.clickToOpen){w.data=h;h._closeAll(w)}}}else{if(h.autoCloseOnClick&&!e&&!h.clickToOpen){if(r.closeOnClick){w.data=h;h._closeAll(w)}}}if(e&&h.autoCloseOnClick){w.data=h;if(!r.hasItems){h._closeAll(w)}}if(w.target.tagName!="A"&&w.target.tagName!="a"){var u=r.anchor!=null?a(r.anchor):null;if(u!=null&&u.length>0){var t=u.attr("href");var v=u.attr("target");if(t!=null){if(v!=null){window.open(t,v)}else{window.location=t}}}}});h.removeHandler(n,"mouseenter");h.removeHandler(n,"mouseleave");if(!c&&h.mode!="simple"){h._renderHover(n,r,e)}if(r.subMenuElement!=null){var o=a(r.subMenuElement);if(h.mode=="simple"){o.show();return true}o.wrap('<div class="jqx-menu-popup '+h.toThemeProperty("jqx-menu-popup")+'" style="border: none; background-color: transparent; z-index:'+i+'; padding: 0px; margin: 0px; position: absolute; top: 0; left: 0; display: block; visibility: hidden;"><div style="background-color: transparent; border: none; position:absolute; overflow:hidden; left: 0; top: 0; right: 0; width: 100%; height: 100%;"></div></div>');o.css({overflow:"hidden",position:"absolute",left:0,display:"inherit",top:-o.outerHeight()});o.data("timer",{});if(r.level>0){o.css("left",-o.outerWidth())}else{if(h.mode=="horizontal"){o.css("left",0)}}i++;var q=a(r.subMenuElement).closest("div.jqx-menu-popup").css({width:parseInt(a(r.subMenuElement).outerWidth())+parseInt(d[0])+"px",height:parseInt(a(r.subMenuElement).outerHeight())+parseInt(d[1])+"px"});var s=n.closest("div.jqx-menu-popup");if(s.length>0){var k=o.css("margin-left");var m=o.css("margin-right");var l=o.css("padding-left");var p=o.css("padding-right");q.appendTo(s);o.css("margin-left",k);o.css("margin-right",m);o.css("padding-left",l);o.css("padding-right",p)}else{var k=o.css("margin-left");var m=o.css("margin-right");var l=o.css("padding-left");var p=o.css("padding-right");q.appendTo(a(document.body));o.css("margin-left",k);o.css("margin-right",m);o.css("padding-left",l);o.css("padding-right",p)}if(!h.clickToOpen){if(e||c){h.removeHandler(n,a.jqx.mobile.getTouchEventName("touchstart"));h.addHandler(n,a.jqx.mobile.getTouchEventName("touchstart"),function(t){clearTimeout(o.data("timer").hide);if(o!=null){o.stop()}if(r.level==0&&!r.isOpen&&h.mode!="popup"){t.data=h;h._closeAll(t)}if(!r.isOpen){h._openItem(h,r)}else{h._closeItem(h,r,true)}return false})}if(!c){h.addHandler(n,"mouseenter",function(){if(h.autoOpen||(r.level>0&&!h.autoOpen)){clearTimeout(o.data("timer").hide)}if(r.parentId&&r.parentId!=0){if(h.menuElements[r.parentId]){var t=h.menuElements[r.parentId].isOpen;if(!t){return}}}if(h.autoOpen||(r.level>0&&!h.autoOpen)){h._openItem(h,r)}return false});h.addHandler(n,"mousedown",function(){if(!h.autoOpen&&r.level==0){clearTimeout(o.data("timer").hide);if(o!=null){o.stop()}if(!r.isOpen){h._openItem(h,r)}else{h._closeItem(h,r,true)}}});h.addHandler(n,"mouseleave",function(u){if(h.autoCloseOnMouseLeave){clearTimeout(o.data("timer").hide);var x=a(r.subMenuElement);var t={left:parseInt(u.pageX),top:parseInt(u.pageY)};var w={left:parseInt(x.coord().left),top:parseInt(x.coord().top),width:parseInt(x.outerWidth()),height:parseInt(x.outerHeight())};var v=true;if(w.left-5<=t.left&&t.left<=w.left+w.width+5){if(w.top<=t.top&&t.top<=w.top+w.height){v=false}}if(v){h._closeItem(h,r,true)}}});h.removeHandler(q,"mouseenter");h.addHandler(q,"mouseenter",function(){clearTimeout(o.data("timer").hide)});h.removeHandler(q,"mouseleave");h.addHandler(q,"mouseleave",function(t){if(h.autoCloseOnMouseLeave){clearTimeout(o.data("timer").hide);clearTimeout(o.data("timer").show);if(o!=null){o.stop()}h._closeItem(h,r,true)}})}}else{h.removeHandler(n,"mousedown");h.addHandler(n,"mousedown",function(t){clearTimeout(o.data("timer").hide);if(o!=null){o.stop()}if(r.level==0&&!r.isOpen){t.data=h;h._closeAll(t)}if(!r.isOpen){h._openItem(h,r)}else{h._closeItem(h,r,true)}})}}});if(this.mode=="simple"){this._renderSimpleMode()}this._autoSizeHorizontalMenuItems();this._raiseEvent("3",this)},_renderSimpleMode:function(){this.host.show()},createID:function(){var b=Math.random()+"";b=b.replace(".","");b="99"+b;b=b/1;while(this.items[b]){b=Math.random()+"";b=b.replace(".","");b=b/1}return"menuItem"+b},_createMenu:function(c,f){if(c==null){return}if(f==undefined){f=true}if(f==null){f=true}var o=this;var u=a(c).find("li");var q=0;this.itemMapping=new Array();for(var j=0;j<u.length;j++){var m=u[j];var s=a(m);if(m.className.indexOf("jqx-menu")==-1&&this.autoGenerate==false){continue}var p=m.id;if(!p){p=this.createID()}if(f){m.id=p;this.items[q]=new a.jqx._jqxMenu.jqxMenuItem();this.menuElements[p]=this.items[q]}q+=1;var t=0;var x=this;var h=s.children();h.each(function(){if(!f){this.className="";if(x.autoGenerate){a(x.items[q-1].subMenuElement)[0].className="";if(!x.minimized){a(x.items[q-1].subMenuElement).addClass(x.toThemeProperty("jqx-widget-content"))}a(x.items[q-1].subMenuElement).addClass(x.toThemeProperty("jqx-menu-dropdown"));a(x.items[q-1].subMenuElement).addClass(x.toThemeProperty("jqx-popup"))}}if(this.className.indexOf("jqx-menu-dropdown")!=-1){if(f){x.items[q-1].subMenuElement=this}return false}else{if(x.autoGenerate&&(this.tagName=="ul"||this.tagName=="UL")){if(f){x.items[q-1].subMenuElement=this}this.className="";if(!x.minimized){a(this).addClass(x.toThemeProperty("jqx-widget-content"))}a(this).addClass(x.toThemeProperty("jqx-menu-dropdown"));a(this).addClass(x.toThemeProperty("jqx-popup"));a(this).attr("role","menu");if(x.rtl){a(this).addClass(x.toThemeProperty("jqx-rc-l"))}else{a(this).addClass(x.toThemeProperty("jqx-rc-r"))}a(this).addClass(x.toThemeProperty("jqx-rc-b"));return false}}});var w=s.parents();w.each(function(){if(this.className.indexOf("jqx-menu-item")!=-1){t=this.id;return false}else{if(x.autoGenerate&&(this.tagName=="li"||this.tagName=="LI")){t=this.id;return false}}});var e=false;var d=m.getAttribute("type");var b=m.getAttribute("ignoretheme")||m.getAttribute("data-ignoretheme");if(b){if(b=="true"||b==true){b=true}}else{b=false}if(!d){d=m.type}else{if(d=="separator"){var e=true}}if(!e){if(t){d="sub"}else{d="top"}}var g=this.items[q-1];if(f){g.id=p;g.parentId=t;g.type=d;g.separator=e;g.element=u[j];var l=s.children("a");g.disabled=m.getAttribute("item-disabled")=="true"?true:false;g.level=s.parents("li").length;g.anchor=l.length>0?l:null;if(g.anchor){a(g.anchor).attr("tabindex",-1)}}g.ignoretheme=b;var n=this.menuElements[t];if(n!=null){if(n.ignoretheme){g.ignoretheme=n.ignoretheme;b=n.ignoretheme}g.parentItem=n;g.parentElement=n.element}if(this.autoGenerate){if(d=="separator"){s.removeClass();s.addClass(this.toThemeProperty("jqx-menu-item-separator"));s.attr("role","separator")}else{if(!b){s[0].className="";if(this.rtl){s.addClass(this.toThemeProperty("jqx-rtl"))}if(g.level>0&&!x.minimized){s.addClass(this.toThemeProperty("jqx-item"));s.addClass(this.toThemeProperty("jqx-menu-item"))}else{s.addClass(this.toThemeProperty("jqx-item"));s.addClass(this.toThemeProperty("jqx-menu-item-top"))}}}}if(g.disabled){s.addClass(x.toThemeProperty("jqx-menu-item-disabled"));s.addClass(x.toThemeProperty("jqx-fill-state-disabled"))}this.itemMapping[j]={element:u[j],item:g};this.itemMapping["id"+u[j].id]=this.itemMapping[j];if(f&&!b){g.hasItems=s.find("li").length>0;if(g.hasItems){if(g.element){a.jqx.aria(a(g.element),"aria-haspopup",true);if(!g.subMenuElement.id){g.subMenuElement.id=a.jqx.utilities.createId()}a.jqx.aria(a(g.element),"aria-owns",g.subMenuElement.id)}}}}for(var r=0;r<u.length;r++){var v=u[r];if(this.itemMapping["id"+v.id]){var g=this.itemMapping["id"+v.id].item;if(!g){continue}g.prevItem=null;g.nextItem=null;if(r>0){if(this.itemMapping["id"+u[r-1].id]){g.prevItem=this.itemMapping["id"+u[r-1].id].item}}if(r<u.length-1){if(this.itemMapping["id"+u[r+1].id]){g.nextItem=this.itemMapping["id"+u[r+1].id].item}}}}},destroy:function(){a.jqx.utilities.resize(this.host,null,true);var d=this.host.closest("div.jqx-menu-wrapper");d.remove();a("#menuWrapper"+this.element.id).remove();var b=this;this.removeHandler(this.host,"keydown");this.removeHandler(this.host,"focus");this.removeHandler(this.host,"blur");this.removeHandler(a(document),"mousedown.menu"+this.element.id,b._closeAfterClick);this.removeHandler(a(document),"mouseup.menu"+this.element.id,b._closeAfterClick);a.data(document.body,"jqxMenuOldHost"+this.element.id,null);if(this.isTouchDevice()){this.removeHandler(a(document),a.jqx.mobile.getTouchEventName("touchstart")+".menu"+this.element.id,this._closeAfterClick,this)}if(a(window).off){a(window).off("resize.menu"+b.element.id)}a.each(this.items,function(){var g=this;var f=a(g.element);b.removeHandler(f,"click");b.removeHandler(f,"selectstart");b.removeHandler(f,"mouseenter");b.removeHandler(f,"mouseleave");b.removeHandler(f,"mousedown");b.removeHandler(f,"mouseleave");var e=a(g.subMenuElement);var h=e.closest("div.jqx-menu-popup");h.remove();delete this.subMenuElement;delete this.element});a.data(document.body,"menuel",null);delete this.menuElements;this.items=new Array();delete this.items;var c=a.data(this.element,"jqxMenu");if(c){delete c.instance}this.host.removeClass();this.host.remove();delete this.host;delete this.element},_raiseEvent:function(f,c){if(c==undefined){c={owner:null}}var d=this.events[f];args=c;args.owner=this;var e=new a.Event(d);if(f=="2"){args=c.item;args.owner=this;a.extend(e,c.event);e.type="itemclick"}e.owner=this;e.args=args;var b=this.host.trigger(e);return b},propertyChangedHandler:function(b,d,h,g){if(this.isInitialized==undefined||this.isInitialized==false){return}if(d=="disabled"){if(b.disabled){b.host.addClass(b.toThemeProperty("jqx-fill-state-disabled"));b.host.addClass(b.toThemeProperty("jqx-menu-disabled"))}else{b.host.removeClass(b.toThemeProperty("jqx-fill-state-disabled"));b.host.removeClass(b.toThemeProperty("jqx-menu-disabled"))}}if(g==h){return}if(d=="touchMode"){this._isTouchDevice=null;b._render(g,h)}if(d==="width"||d==="height"){b.setSize();if(b.mode==="popup"){var e=this.host.closest("div.jqx-menu-wrapper");e[d](g);var i=this.host[0].id;a("#"+i)[d](g)}return}if(d=="source"){if(b.source!=null){var c=b.loadItems(b.source);b.element.innerHTML=c;var f=b.host.find("ul:first");if(f.length>0){b.refresh();b._createMenu(f[0]);b._render()}}}if(d=="autoCloseOnClick"){if(g==false){b.removeHandler(a(document),"mousedown.menu"+this.element.id,b._closeAll)}else{b.addHandler(a(document),"mousedown.menu"+this.element.id,b,b._closeAll)}}else{if(d=="mode"||d=="width"||d=="height"||d=="showTopLevelArrows"){b.refresh();if(d=="mode"){b._render(g,h)}else{b._applyOrientation()}}else{if(d=="theme"){a.jqx.utilities.setTheme(h,g,b.host)}}}}})})(jqxBaseFramework);(function(a){a.jqx._jqxMenu.jqxMenuItem=function(e,d,c){var b={id:e,parentId:d,parentItem:null,anchor:null,type:c,disabled:false,level:0,isOpen:false,hasItems:false,element:null,subMenuElement:null,arrow:null,openHorizontalDirection:"right",openVerticalDirection:"down",closeOnClick:true};return b}})(jqxBaseFramework);

mercurial