www-thermferm/jqwidgets/jqxlistmenu.js

changeset 511
2d1d43c3a2c2
parent 373
f6850e0b5d35
child 617
b216f9d4b917
--- a/www-thermferm/jqwidgets/jqxlistmenu.js	Fri May 19 16:34:21 2017 +0200
+++ b/www-thermferm/jqwidgets/jqxlistmenu.js	Sun May 28 14:19:57 2017 +0200
@@ -1,7 +1,7 @@
 /*
-jQWidgets v3.8.0 (2015-Apr)
-Copyright (c) 2011-2015 jQWidgets.
+jQWidgets v4.5.2 (2017-May)
+Copyright (c) 2011-2017 jQWidgets.
 License: http://jqwidgets.com/license/
-*/
-
-(function(c){c.jqx.jqxWidget("jqxListMenu","",{});var a=0,b=0;c.extend(c.jqx._jqxListMenu.prototype,{defineInstance:function(){var d={filterCallback:function(g,f){var e=c.jqx.string.containsIgnoreCase(c.trim(g),f);return e},placeHolder:"Filter list items...",showFilter:false,showHeader:true,showBackButton:true,showNavigationArrows:true,alwaysShowNavigationArrows:false,backLabel:"Back",width:"100%",height:"auto",animationType:"slide",animationDuration:0,headerAnimationDuration:0,autoSeparators:false,readOnly:false,roundedCorners:true,disabled:false,enableScrolling:true,touchMode:false,_childrenMap:{},_parentMap:{},_lock:false,_backButton:null,_currentPage:null,_header:null,_oldHost:undefined,rtl:false,aria:{"aria-disabled":{name:"disabled",type:"boolean"}}};c.extend(true,this,d);return d},destroy:function(){this.host.remove()},createInstance:function(){c.jqx.aria(this);this.host.attr("data-role","listmenu");this.host.attr("role","tree")},refresh:function(d){this._render();this._removeClasses();this._addClasses();this._currentPage=this._currentPage||this.host.children(".jqx-listmenu").first();this._changeHeader(this._currentPage);this._removeEventHandlers();this._addEventHandlers()},_render:function(){this._renderHost();this._renderAutoSeparators();this._renderSublists();this._renderFilterBar();this._renderHeader();this.host.css({width:this.width,height:this.height});if(this.disabled){this.disable()}if(this.enableScrolling&&this.host.jqxPanel&&this.panel){this.panel.jqxPanel("_arrange")}},resize:function(e,d){this.width=e;this.height=d;this.host.css({width:this.width,height:this.height});if(this.panel){this.panel.jqxPanel("_arrange")}},_renderHost:function(){if(!this.host.is("div")){this._oldHost=this.host;this.host.wrap("<div/>");this.host=this.host.parent();this.element=this.host[0];if(this.host.jqxPanel&&this.enableScrolling){this.host.wrap("<div/>");this.panel=this.host.parent();this.panel[0].id="panel"+this.element.id;this.panel.jqxPanel({theme:this.theme,autoUpdate:true,width:this.width,height:this.height,touchMode:this.touchMode});this.host.css({width:"100%"});this.host.css({height:"auto"});this.host.css("border","none")}}else{this.element.style.overflow="hidden"}if(!this.enableScrolling){this.element.style.overflow="hidden"}if(c.jqx.browser.msie&&c.jqx.browser.version<8){this.element.style.position="relative"}if(this.enableScrolling&&this.panel){this.panel.jqxPanel("_arrange")}},_renderAutoSeparators:function(g){var f=this.host.find(".jqx-listmenu-auto-separator"),d=this.host.find('[data-role="listmenu"]'),g,e;f.remove();for(e=0;e<d.length;e+=1){g=c(d[e]);if(g.data("auto-separators")||this.autoSeparators){this._renderListAutoSeparators(g)}}},_renderSublists:function(){var e=[(this.host.find(".jqx-listmenu").first()[0]||this.host.find("ul,ol").first()[0])],g,d,k,f,j;this._refreshList(e[0]);while(e.length){k=e.pop();g=this._getChildrenByTagName(k,"li","LI");f=g.length;for(var h=0;h<f;h+=1){d=g[h];c(d).attr("role","treeitem");j=this._getChildList(d);this._refreshLi(d,h,f);if(j){e.push(j);this._refreshList(j,d,true)}}}},_refreshList:function(f,e,d){f=c(f);if(f.data("role")==="listmenu"){if(!f.is(".jqx-listmenu")){this._renderList(f);this._handleListId(f);this._addListClasses(f)}if(e){this._expandHierarchy(f[0],e)}if(d){this._handleSublist(f[0])}}},_renderList:function(d){d=c(d);if(!d.is(".jqx-listmenu")){d.detach();d.appendTo(this.host)}},_handleListId:function(d){if(!d[0].id){d[0].id="jqx-listmenu-"+b;b+=1}},_renderListAutoSeparators:function(h){var e=h.children("li"),k,d;var j={};for(var g=0;g<e.length;g+=1){d=c(e[g]);if(!d.data("role")){if(c.trim(d.text())[0]!==k){k=c.trim(d.text())[0];var f=c('<li data-role="separator" class="'+this.toThemeProperty("jqx-listmenu-auto-separator")+'">'+k+"</li>");f.insertBefore(d);f[0].items=new Array();j=f[0]}if(j.items){j.items[j.items.length]=d[0]}}}},_addListClasses:function(d){d.addClass("jqx-listmenu")},_expandHierarchy:function(g,f){if(f&&g){var e=f.id,d=g.id;this._childrenMap[e]=d;this._parentMap[d]=e}},_handleSublist:function(d){if(!this._currentPage||d!==this._currentPage[0]){d.style.display="none"}else{d.style.display="block"}},_getChildrenByTagName:function(f,e,g){var d=[],h={};h[e]=h[g]=true;f=f.firstChild;while(f){if(h[f.nodeName]){d.push(f)}f=f.nextSibling}return d},_renderFilterBar:function(){if(!this._filterBar){this._filterBar=c("<div/>");this._filterInput=c('<input type="text" />');this._filterBar.append(this._filterInput);this.host.prepend(this._filterBar)}var d=false;if(c.jqx.browser.msie&&c.jqx.browser.version<8){d=true}if(!d){this._filterInput.attr("placeholder",this.placeHolder)}if(!this.showFilter){this._filterBar.css("display","none")}else{this._filterBar.css("display","block")}},_renderHeader:function(){if(!this._header){this._header=c("<div/>");this.host.prepend(this._header);this._renderHeaderLabel()}this._renderBackButton();if(!this.showHeader){this._header.css("display","none")}else{this._header.css("display","block")}},_renderHeaderLabel:function(){this._headerLabel=c("<span/>");this._headerLabel.addClass(this.toThemeProperty("jqx-listmenu-header-label"));this._header.append(this._headerLabel)},_renderBackButton:function(){if(!this._backButton){this._backButton=c('<div><div style="float: left;"></div><span style="float: left;">'+this.backLabel+'</span><div style="clear:both;"></div></div>');this._header.prepend(this._backButton);this._backButton.jqxButton({theme:this.theme});this._backButton.find("div:first").addClass(this.toThemeProperty("jqx-listmenu-backbutton-arrow"));if(!this.showBackButton){this._backButton.css("display","none")}else{this._backButton.css("display","inline-block")}if(this.rtl){var d=c.jqx.browser.msie&&c.jqx.browser.version<8;if(!d){this._backButton.css("position","relative");this._backButton.css("margin-left","100%");this._backButton.css("left",-this._backButton.outerWidth()-15)}else{this._backButton.css("position","relative");this._backButton.css("left","100%");this._backButton.css("margin-left",-this._backButton.outerWidth()-45+"px")}}}if(!this.showBackButton){this._backButton.css("display","none")}else{this._backButton.css("display","inline-block")}},_removeEventHandlers:function(){var d=this.isTouchDevice()&&!this.touchMode;var e=c.jqx.mobile.getTouchEventName("touchstart");this.removeHandler(this._backButton,!d?"click":e);this.removeHandler(this._filterInput,"keyup");this.removeHandler(this._filterInput,"change")},_addEventHandlers:function(){var d=this;var e=this.isTouchDevice()&&!this.touchMode;var f=c.jqx.mobile.getTouchEventName("touchstart");this.addHandler(this._backButton,!e?"click":f,function(){d.back()});this.addHandler(this._filterInput,"keyup change",function(){d._filter(c(this).val())})},_getChildList:function(d){if(!d){return}var h=this._childrenMap[d.id],g;if(d.className.indexOf("jqx-listmenu-item")>=0&&h){return document.getElementById(h)}var f=this._getChildrenByTagName(d,"ul","UL")[0],e=this._getChildrenByTagName(d,"ol","OL")[0];g=f||e;return g},_refreshLi:function(d,g,f){if(d.parentNode&&d.parentNode.getAttribute("data-role")==="listmenu"){if(d.id==""){var e=2}this._handleLiId(d);this._renderLi(d);this._removeLiEventHandlers(d);this._addLiEventHandlers(d);this._addLiClasses(d,g,f)}},_handleLiId:function(d){if(!d.id){d.id="jqx-listmenu-item-"+a;a+=1}},_renderLi:function(d){if((/(separator|header)/).test(c(d).data("role"))||c(d).children(".jqx-listmenu-arrow-right").length>0){return}c(d).wrapInner('<span class="'+this.toThemeProperty("jqx-listmenu-item-label")+'"></span>');if(this.showNavigationArrows||this.alwaysShowNavigationArrows){var f=c("<span/>");var g=c(d).find("ul");var e=c(d).find("ol");if(this.alwaysShowNavigationArrows||(((g.length>0)&&(/(listmenu)/).test(g.data("role")))||((e.length>0)&&(/(listmenu)/).test(e.data("role"))))){f.addClass(this.toThemeProperty("jqx-listmenu-arrow-right"));if(!this.rtl){f.addClass(this.toThemeProperty("jqx-icon-arrow-right"));f.appendTo(d)}else{f.addClass(this.toThemeProperty("jqx-icon-arrow-left"));f.addClass(this.toThemeProperty("jqx-listmenu-arrow-rtl"));f.prependTo(d)}}}},_removeLiEventHandlers:function(d){var g=this.isTouchDevice();var j=c.jqx.mobile.getTouchEventName("touchstart");var i=c.jqx.mobile.getTouchEventName("touchend");var e=c.jqx.mobile.getTouchEventName("touchmove");var f=(!g?"mousedown":j)+".listmenu";var h=(!g?"mouseup":i)+".listmenu";this.removeHandler(c(d),f);this.removeHandler(c(document),h+"."+d.id)},isTouchDevice:function(){var d=c.jqx.mobile.isTouchDevice();if(this.touchMode==true){d=true}return d},_addLiEventHandlers:function(m){m=c(m);var o=this,f=this.toThemeProperty("jqx-listmenu-arrow-right-pressed"),k=m.children(".jqx-listmenu-arrow-right");var d=c.jqx.mobile.isTouchDevice();var j=c.jqx.mobile.getTouchEventName("touchstart");var l=c.jqx.mobile.getTouchEventName("touchend");var g=c.jqx.mobile.getTouchEventName("touchmove");var h=(!d?"mousedown":j)+".listmenu";var e=(!d?"mouseup":l)+".listmenu";var n=null;var i="";if(!(/(separator|readonly)/).test(m.data("role"))&&!this.readOnly){this.addHandler(m,"dragstart",function(){return false});this.addHandler(m,h,function(p){if(!o.disabled){n=p.target;i=c.jqx.position(p);if(m.find('div[data-role="content"]').length==0){if(!d){m.addClass(o.toThemeProperty("jqx-fill-state-pressed"));k.addClass(f)}}}});this.addHandler(m,e,function(p){if(!o.disabled){if(n==p.target||!d){if(d){if(c.jqx.position(p).top===i.top){o.next(m)}}else{if(c.jqx.position(p).top===i.top){o.next(m)}}}}});this.addHandler(c(document),e+"."+m[0].id,function(){if(!o.disabled){m.removeClass(o.toThemeProperty("jqx-fill-state-pressed"));k.removeClass(f)}})}},_addLiClasses:function(d,f,e){d=c(d);if(d.data("role")==="separator"){this._handleSeparatorStyle(d)}else{if(d.data("role")==="header"){this._handleHeaderStyle(d)}else{if(this.readOnly||d.data("role")==="readonly"){d.addClass(this.toThemeProperty("jqx-listmenu-item-readonly"))}else{d.removeClass(this.toThemeProperty("jqx-listmenu-item-readonly"))}this._handleItemStyle(d)}}if(f===0&&!this.showHeader&&!this.showFilter){d.addClass(this.toThemeProperty("jqx-rc-t"))}if(f===e-1){d.addClass(this.toThemeProperty("jqx-rc-b"))}},_handleSeparatorStyle:function(d){d.addClass(this.toThemeProperty("jqx-listmenu-separator"));d.addClass(this.toThemeProperty("jqx-fill-state-pressed"));d[0].style.listStyle="none"},_handleHeaderStyle:function(d){d.css("display","none")},_handleItemStyle:function(d){d.addClass(this.toThemeProperty("jqx-listmenu-item"));if(this.rtl){d.addClass(this.toThemeProperty("jqx-rtl"))}d.addClass(this.toThemeProperty("jqx-fill-state-normal"));d.addClass(this.toThemeProperty("jqx-item"))},back:function(){var e=this._currentPage,d;if(e){d=this._parentMap[e[0].id]}this._back=true;if(c("#"+d).length>0){c.jqx.aria(c("#"+d),"aria-expanded",false)}this._changePage(e,c("#"+d).parent(),this.animationDuration,true);this._back=false},next:function(d){var h=d.attr("id"),f=this._childrenMap[h],g=c("#"+f),e=c("#"+h).parent();c.jqx.aria(d,"aria-expanded",true);this._changePage(e,g,this.animationDuration)},changePage:function(d){if(typeof d==="string"){d=c(d)}if(!d[0]||(d.attr("data-role")!=="listmenu")||d.parents().index(this.host)<0){throw new Error("Invalid newPage. The chosen newPage is not listmenu or it's not part of the selected jqxListMenu hierarchy.")}if(this._currentPage[0]==d[0]){return}this._changePage(this._currentPage,d,this.animationDuration)},_changePage:function(h,f,g,e){if(!this._lock){var d="_"+this.animationType+"Change"+(e?"Back":"");if(f[0]){if(this.showFilter){if(f.find('div[data-role="content"]').length>0){c.each(f.find("li"),function(){if(c(this).data("role")==="separator"){c(this).hide()}});this._filterBar.css("display","none")}else{this._filterBar.css("display","block")}}this._lock=true;this[d](h,f,this.animationDuration,function(){this._lock=false;this._changeHeader(f);this._currentPage=f})}}},_changeHeader:function(e){var f=c(e).find('li[data-role="header"]').first();if(f[0]){var d=this;this._headerLabel.fadeOut(this.headerAnimationDuration/2,function(){d._headerLabel.html(f.html());d._headerLabel.fadeIn(d.headerAnimationDuration/2)})}},_slideChange:function(h,e,g,i){var d=this;if(this.enableScrolling&&this.panel!=null){this.panel.jqxPanel("scrollTo",0,0)}var f=this.rtl;this._initSlide(h,e);if(!f){h.animate({"margin-left":-h.width()-parseInt(h.css("margin-right"),10)||0},g,"easeInOutSine");e.animate({"margin-left":0},g,"easeInOutSine",function(){d._slideEnd(h,e);i.call(d,c(this))})}else{h.animate({"margin-left":h.width()+parseInt(h.css("margin-right"),10)||0},g,"easeInOutSine");e.animate({"margin-left":0},g,"easeInOutSine",function(){d._slideEnd(h,e);i.call(d,c(this))})}},_initSlide:function(f,d){var e=this.rtl;f.width(f.width());d.css({marginTop:-(f.outerHeight(true)),marginLeft:!e?f.width()+(parseInt(f.css("margin-right"),10)||0):-f.width()-(parseInt(f.css("margin-right"),10)||0),display:"block",height:"auto",width:f.width()})},_slideEnd:function(e,d){this.host.css("height","auto");e.css({display:"none",width:"auto",height:"auto",marginTop:0,marginLeft:0});d.css({marginTop:0,marginLeft:0,height:"auto",width:"auto",display:"block"})},_slideChangeBack:function(g,e,f,h){var d=this;this._initSlideBack(g,e);g.animate({"margin-left":!this.rtl?g.width()+parseInt(g.css("margin-right"),10)||0:-g.width()-parseInt(g.css("margin-right"),10)||0},f);e.animate({"margin-left":0},f,function(){d._slideEnd(g,e);h.call(d,c(this))})},_initSlideBack:function(e,d){e.css({marginTop:-(d.outerHeight(true)),width:e.width()});d.css({width:e.width(),marginLeft:!this.rtl?-e.width()-parseInt(e.css("margin-right"),10)||0:e.width()+parseInt(e.css("margin-right"),10)||0,display:"block",height:"auto"})},_fadeChangeBack:function(f,d,e,g){this._fadeChange(f,d,e,g)},_fadeChange:function(g,e,f,h){var d=this;g.fadeOut(f/2,function(){e.fadeIn(f/2,function(){h.call(d,c(this))})})},_removeClasses:function(){this._filterBar.removeClass(this.toThemeProperty("jqx-listmenu-filter"));this._filterBar.removeClass(this.toThemeProperty("jqx-widget-header"));this._filterInput.removeClass(this.toThemeProperty("jqx-listmenu-filter-input"));this._filterInput.removeClass(this.toThemeProperty("jqx-input"));this._header.removeClass(this.toThemeProperty("jqx-listmenu-header"));this._header.removeClass(this.toThemeProperty("jqx-widget-header"));this._header.removeClass(this.toThemeProperty("jqx-rc-t"));if(this.roundedCorners){this.host.removeClass(this.toThemeProperty("jqx-rc-all"))}this.host.removeClass(this.toThemeProperty("jqx-widget"));this.host.removeClass(this.toThemeProperty("jqx-listmenu-widget"));this.host.removeClass(this.toThemeProperty("jqx-fill-state-normal"));this.host.removeClass(this.toThemeProperty("jqx-reset"));if(this.host.find('div[data-role="content"]').length>0){this.host.find('div[data-role="content"]').removeClass(this.toThemeProperty("jqx-widget-content"))}},_addClasses:function(){if(this.roundedCorners){this.host.addClass(this.toThemeProperty("jqx-rc-all"))}else{this.host.removeClass(this.toThemeProperty("jqx-rc-all"))}this.host.addClass("jqx-widget");this.host.addClass("jqx-listmenu-widget");this.host.addClass("jqx-fill-state-normal");this.host.addClass("jqx-reset");this._filterBar.addClass(this.toThemeProperty("jqx-listmenu-filter"));this._filterBar.addClass(this.toThemeProperty("jqx-widget-header"));this._filterInput.addClass(this.toThemeProperty("jqx-listmenu-filter-input"));this._filterInput.addClass(this.toThemeProperty("jqx-input"));this._header.addClass(this.toThemeProperty("jqx-listmenu-header"));this._header.addClass(this.toThemeProperty("jqx-widget-header"));this._header.addClass(this.toThemeProperty("jqx-rc-t"));if(this.host.find('div[data-role="content"]').length>0){this.host.find('div[data-role="content"]').addClass(this.toThemeProperty("jqx-widget-content"))}},_raiseEvent:function(){},_filter:function(h){var f=this.host.find(".jqx-listmenu-item");for(var e=0;e<f.length;e+=1){var g=c.trim(c(f[e]).text());if(!this.filterCallback(g,h)){f[e].style.display="none"}else{f[e].style.display="block"}}var f=this.host.find(".jqx-listmenu-separator");for(var e=0;e<f.length;e+=1){var d=false;c.each(f[e].items,function(){if(c(this).css("display")!="none"){d=true;return false}});if(!d){f[e].style.display="none"}else{f[e].style.display="block"}}},disable:function(){this.host.addClass(this.toThemeProperty("jqx-fill-state-disabled"));this.disabled=true},enable:function(){this.host.removeClass(this.toThemeProperty("jqx-fill-state-disabled"));this.disabled=false},propertyChangedHandler:function(d,e,g,f){if(e=="disabled"){if(f){d.disable()}else{d.enable()}}if(e==="backLabel"){d._backButton.html(f);return}else{if(e==="placeHolder"){d._filterInput.attr("placeholder",f)}else{if((/(showFilter|showHeader|showBackButton|width|height|autoSeparators|readOnly)/).test(e)){d._render();return}}}}})}(jqxBaseFramework));
\ No newline at end of file
+*/
+!function(a){a.jqx.jqxWidget("jqxListMenu","",{});var b=0,c=0;a.extend(a.jqx._jqxListMenu.prototype,{defineInstance:function(){var b={filterCallback:function(b,c){var d=a.jqx.string.containsIgnoreCase(a.trim(b),c);return d},placeHolder:"Filter list items...",showFilter:!1,showHeader:!0,showBackButton:!0,showNavigationArrows:!0,alwaysShowNavigationArrows:!1,backLabel:"Back",width:"100%",height:"auto",animationType:"slide",animationDuration:0,headerAnimationDuration:0,autoSeparators:!1,readOnly:!1,roundedCorners:!0,disabled:!1,enableScrolling:!0,touchMode:!1,_childrenMap:{},_parentMap:{},_lock:!1,_backButton:null,_currentPage:null,_header:null,_oldHost:void 0,rtl:!1,aria:{"aria-disabled":{name:"disabled",type:"boolean"}}};return this===a.jqx._jqxListMenu.prototype?b:(a.extend(!0,this,b),b)},destroy:function(){this.host.remove()},createInstance:function(){a.jqx.aria(this),this.host.attr("data-role","listmenu"),this.host.attr("role","tree")},refresh:function(a){this._render(),this._removeClasses(),this._addClasses(),this._currentPage=this._currentPage||this.host.children(".jqx-listmenu").first(),this._changeHeader(this._currentPage),this._removeEventHandlers(),this._addEventHandlers()},_render:function(){this._renderHost(),this._renderAutoSeparators(),this._renderSublists(),this._renderFilterBar(),this._renderHeader(),this.host.css({width:this.width,height:this.height}),this.disabled&&this.disable(),this.enableScrolling&&this.host.jqxPanel&&this.panel&&this.panel.jqxPanel("_arrange")},resize:function(a,b){this.width=a,this.height=b,this.host.css({width:this.width,height:this.height}),this.panel&&this.panel.jqxPanel("_arrange")},_renderHost:function(){this.host.is("div")?this.element.style.overflow="hidden":(this._oldHost=this.host,this.host.wrap("<div/>"),this.host=this.host.parent(),this.element=this.host[0],this.host.jqxPanel&&this.enableScrolling&&(this.host.wrap("<div/>"),this.panel=this.host.parent(),this.panel[0].id="panel"+this.element.id,this.panel.jqxPanel({theme:this.theme,autoUpdate:!0,width:this.width,height:this.height,touchMode:this.touchMode}),this.host.css({width:"100%"}),this.host.css({height:"auto"}),this.host.css("border","none"))),this.enableScrolling||(this.element.style.overflow="hidden"),a.jqx.browser.msie&&a.jqx.browser.version<8&&(this.element.style.position="relative"),this.enableScrolling&&this.panel&&this.panel.jqxPanel("_arrange")},_renderAutoSeparators:function(b){var b,c,d=this.host.find(".jqx-listmenu-auto-separator"),e=this.host.find('[data-role="listmenu"]');for(d.remove(),c=0;c<e.length;c+=1)b=a(e[c]),(b.data("auto-separators")||this.autoSeparators)&&this._renderListAutoSeparators(b)},_renderSublists:function(){var b,c,d,e,f,g=[this.host.find(".jqx-listmenu").first()[0]||this.host.find("ul,ol").first()[0]];for(this._refreshList(g[0]);g.length;){d=g.pop(),b=this._getChildrenByTagName(d,"li","LI"),e=b.length;for(var h=0;h<e;h+=1)c=b[h],a(c).attr("role","treeitem"),f=this._getChildList(c),this._refreshLi(c,h,e),f&&(g.push(f),this._refreshList(f,c,!0))}},_refreshList:function(b,c,d){b=a(b),"listmenu"===b.data("role")&&(b.is(".jqx-listmenu")||(this._renderList(b),this._handleListId(b),this._addListClasses(b)),c&&this._expandHierarchy(b[0],c),d&&this._handleSublist(b[0]))},_renderList:function(b){b=a(b),b.is(".jqx-listmenu")||(b.detach(),b.appendTo(this.host))},_handleListId:function(a){a[0].id||(a[0].id="jqx-listmenu-"+c,c+=1)},_renderListAutoSeparators:function(b){for(var c,d,e=b.children("li"),f={},g=0;g<e.length;g+=1)if(d=a(e[g]),!d.data("role")){if(a.trim(d.text())[0]!==c){c=a.trim(d.text())[0];var h=a('<li data-role="separator" class="'+this.toThemeProperty("jqx-listmenu-auto-separator")+'">'+c+"</li>");h.insertBefore(d),h[0].items=new Array,f=h[0]}f.items&&(f.items[f.items.length]=d[0])}},_addListClasses:function(a){a.addClass("jqx-listmenu")},_expandHierarchy:function(a,b){if(b&&a){var c=b.id,d=a.id;this._childrenMap[c]=d,this._parentMap[d]=c}},_handleSublist:function(a){this._currentPage&&a===this._currentPage[0]?a.style.display="block":a.style.display="none"},_getChildrenByTagName:function(a,b,c){var d=[],e={};for(e[b]=e[c]=!0,a=a.firstChild;a;)e[a.nodeName]&&d.push(a),a=a.nextSibling;return d},_renderFilterBar:function(){this._filterBar||(this._filterBar=a("<div/>"),this._filterInput=a('<input type="text" />'),this._filterBar.append(this._filterInput),this.host.prepend(this._filterBar));var b=!1;a.jqx.browser.msie&&a.jqx.browser.version<8&&(b=!0),b||this._filterInput.attr("placeholder",this.placeHolder),this.showFilter?this._filterBar.css("display","block"):this._filterBar.css("display","none")},_renderHeader:function(){this._header||(this._header=a("<div/>"),this.host.prepend(this._header),this._renderHeaderLabel()),this._renderBackButton(),this.showHeader?this._header.css("display","block"):this._header.css("display","none")},_renderHeaderLabel:function(){this._headerLabel=a("<span/>"),this._headerLabel.addClass(this.toThemeProperty("jqx-listmenu-header-label")),this._header.append(this._headerLabel)},_renderBackButton:function(){if(!this._backButton&&(this._backButton=a('<div><div style="float: left;"></div><span style="float: left;">'+this.backLabel+'</span><div style="clear:both;"></div></div>'),this._header.prepend(this._backButton),this._backButton.jqxButton({theme:this.theme}),this._backButton.find("div:first").addClass(this.toThemeProperty("jqx-listmenu-backbutton-arrow")),this.showBackButton?this._backButton.css("display","inline-block"):this._backButton.css("display","none"),this.rtl)){var b=a.jqx.browser.msie&&a.jqx.browser.version<8;b?(this._backButton.css("position","relative"),this._backButton.css("left","100%"),this._backButton.css("margin-left",-this._backButton.outerWidth()-45+"px")):(this._backButton.css("position","relative"),this._backButton.css("margin-left","100%"),this._backButton.css("left",-this._backButton.outerWidth()-15))}this.showBackButton?this._backButton.css("display","inline-block"):this._backButton.css("display","none")},_removeEventHandlers:function(){var b=this.isTouchDevice()&&!this.touchMode,c=a.jqx.mobile.getTouchEventName("touchstart");this.removeHandler(this._backButton,b?c:"click"),this.removeHandler(this._filterInput,"keyup"),this.removeHandler(this._filterInput,"change")},_addEventHandlers:function(){var b=this,c=this.isTouchDevice()&&!this.touchMode,d=a.jqx.mobile.getTouchEventName("touchstart");this.addHandler(this._backButton,c?d:"click",function(){b.back()}),this.addHandler(this._filterInput,"keyup change",function(){b._filter(a(this).val())})},_getChildList:function(a){if(a){var b,c=this._childrenMap[a.id];if(a.className.indexOf("jqx-listmenu-item")>=0&&c)return document.getElementById(c);var d=this._getChildrenByTagName(a,"ul","UL")[0],e=this._getChildrenByTagName(a,"ol","OL")[0];return b=d||e}},_refreshLi:function(a,b,c){if(a.parentNode&&"listmenu"===a.parentNode.getAttribute("data-role")){if(""==a.id);this._handleLiId(a),this._renderLi(a),this._removeLiEventHandlers(a),this._addLiEventHandlers(a),this._addLiClasses(a,b,c)}},_handleLiId:function(a){a.id||(a.id="jqx-listmenu-item-"+b,b+=1)},_renderLi:function(b){if(!(/(separator|header)/.test(a(b).data("role"))||a(b).children(".jqx-listmenu-arrow-right").length>0)&&(a(b).wrapInner('<span class="'+this.toThemeProperty("jqx-listmenu-item-label")+'"></span>'),this.showNavigationArrows||this.alwaysShowNavigationArrows)){var c=a("<span/>"),d=a(b).find("ul"),e=a(b).find("ol");(this.alwaysShowNavigationArrows||d.length>0&&/(listmenu)/.test(d.data("role"))||e.length>0&&/(listmenu)/.test(e.data("role")))&&(c.addClass(this.toThemeProperty("jqx-listmenu-arrow-right")),this.rtl?(c.addClass(this.toThemeProperty("jqx-icon-arrow-left")),c.addClass(this.toThemeProperty("jqx-listmenu-arrow-rtl")),c.prependTo(b)):(c.addClass(this.toThemeProperty("jqx-icon-arrow-right")),c.appendTo(b)))}},_removeLiEventHandlers:function(b){var c=this.isTouchDevice(),d=a.jqx.mobile.getTouchEventName("touchstart"),e=a.jqx.mobile.getTouchEventName("touchend"),f=(a.jqx.mobile.getTouchEventName("touchmove"),(c?d:"mousedown")+".listmenu"),g=(c?e:"mouseup")+".listmenu";this.removeHandler(a(b),f),this.removeHandler(a(document),g+"."+b.id)},isTouchDevice:function(){var b=a.jqx.mobile.isTouchDevice();return 1==this.touchMode&&(b=!0),b},_addLiEventHandlers:function(b){b=a(b);var c=this,d=this.toThemeProperty("jqx-listmenu-arrow-right-pressed"),e=b.children(".jqx-listmenu-arrow-right"),f=a.jqx.mobile.isTouchDevice(),g=a.jqx.mobile.getTouchEventName("touchstart"),h=a.jqx.mobile.getTouchEventName("touchend"),i=(a.jqx.mobile.getTouchEventName("touchmove"),(f?g:"mousedown")+".listmenu"),j=(f?h:"mouseup")+".listmenu",k=null,l="";/(separator|readonly)/.test(b.data("role"))||this.readOnly||(this.addHandler(b,"dragstart",function(){return!1}),this.addHandler(b,i,function(g){c.disabled||(k=g.target,l=a.jqx.position(g),0==b.find('div[data-role="content"]').length&&(f||(b.addClass(c.toThemeProperty("jqx-fill-state-pressed")),e.addClass(d))))}),this.addHandler(b,j,function(d){c.disabled||k!=d.target&&f||(f?a.jqx.position(d).top===l.top&&c.next(b):a.jqx.position(d).top===l.top&&c.next(b))}),this.addHandler(a(document),j+"."+b[0].id,function(){c.disabled||(b.removeClass(c.toThemeProperty("jqx-fill-state-pressed")),e.removeClass(d))}))},_addLiClasses:function(b,c,d){b=a(b),"separator"===b.data("role")?this._handleSeparatorStyle(b):"header"===b.data("role")?this._handleHeaderStyle(b):(this.readOnly||"readonly"===b.data("role")?b.addClass(this.toThemeProperty("jqx-listmenu-item-readonly")):b.removeClass(this.toThemeProperty("jqx-listmenu-item-readonly")),this._handleItemStyle(b)),0!==c||this.showHeader||this.showFilter||b.addClass(this.toThemeProperty("jqx-rc-t")),c===d-1&&b.addClass(this.toThemeProperty("jqx-rc-b"))},_handleSeparatorStyle:function(a){a.addClass(this.toThemeProperty("jqx-listmenu-separator")),a.addClass(this.toThemeProperty("jqx-fill-state-pressed")),a[0].style.listStyle="none"},_handleHeaderStyle:function(a){a.css("display","none")},_handleItemStyle:function(a){a.addClass(this.toThemeProperty("jqx-listmenu-item")),this.rtl&&a.addClass(this.toThemeProperty("jqx-rtl")),a.addClass(this.toThemeProperty("jqx-fill-state-normal")),a.addClass(this.toThemeProperty("jqx-item"))},back:function(){var b,c=this._currentPage;c&&(b=this._parentMap[c[0].id]),this._back=!0,a("#"+b).length>0&&a.jqx.aria(a("#"+b),"aria-expanded",!1),this._changePage(c,a("#"+b).parent(),this.animationDuration,!0),this._back=!1},next:function(b){var c=b.attr("id"),d=this._childrenMap[c],e=a("#"+d),f=a("#"+c).parent();a.jqx.aria(b,"aria-expanded",!0),this._changePage(f,e,this.animationDuration)},changePage:function(b){if("string"==typeof b&&(b=a(b)),!b[0]||"listmenu"!==b.attr("data-role")||b.parents().index(this.host)<0)throw new Error("Invalid newPage. The chosen newPage is not listmenu or it's not part of the selected jqxListMenu hierarchy.");this._currentPage[0]!=b[0]&&this._changePage(this._currentPage,b,this.animationDuration)},_changePage:function(b,c,d,e){if(!this._lock){var f="_"+this.animationType+"Change"+(e?"Back":"");c[0]&&(this.showFilter&&(c.find('div[data-role="content"]').length>0?(a.each(c.find("li"),function(){"separator"===a(this).data("role")&&a(this).hide()}),this._filterBar.css("display","none")):this._filterBar.css("display","block")),this._lock=!0,this[f](b,c,this.animationDuration,function(){this._lock=!1,this._changeHeader(c),this._currentPage=c}))}},_changeHeader:function(b){var c=a(b).find('li[data-role="header"]').first();if(c[0]){var d=this;this._headerLabel.fadeOut(this.headerAnimationDuration/2,function(){d._headerLabel.html(c.html()),d._headerLabel.fadeIn(d.headerAnimationDuration/2)})}},_slideChange:function(b,c,d,e){var f=this;this.enableScrolling&&null!=this.panel&&this.panel.jqxPanel("scrollTo",0,0);var g=this.rtl;this._initSlide(b,c),g?(b.animate({"margin-left":b.width()+parseInt(b.css("margin-right"),10)||0},d,"easeInOutSine"),c.animate({"margin-left":0},d,"easeInOutSine",function(){f._slideEnd(b,c),e.call(f,a(this))})):(b.animate({"margin-left":-b.width()-parseInt(b.css("margin-right"),10)||0},d,"easeInOutSine"),c.animate({"margin-left":0},d,"easeInOutSine",function(){f._slideEnd(b,c),e.call(f,a(this))}))},_initSlide:function(a,b){var c=this.rtl;a.width(a.width()),b.css({marginTop:-a.outerHeight(!0),marginLeft:c?-a.width()-(parseInt(a.css("margin-right"),10)||0):a.width()+(parseInt(a.css("margin-right"),10)||0),display:"block",height:"auto",width:a.width()})},_slideEnd:function(a,b){this.host.css("height","auto"),a.css({display:"none",width:"auto",height:"auto",marginTop:0,marginLeft:0}),b.css({marginTop:0,marginLeft:0,height:"auto",width:"auto",display:"block"})},_slideChangeBack:function(b,c,d,e){var f=this;this._initSlideBack(b,c),b.animate({"margin-left":this.rtl?-b.width()-parseInt(b.css("margin-right"),10)||0:b.width()+parseInt(b.css("margin-right"),10)||0},d),c.animate({"margin-left":0},d,function(){f._slideEnd(b,c),e.call(f,a(this))})},_initSlideBack:function(a,b){a.css({marginTop:-b.outerHeight(!0),width:a.width()}),b.css({width:a.width(),marginLeft:this.rtl?a.width()+parseInt(a.css("margin-right"),10)||0:-a.width()-parseInt(a.css("margin-right"),10)||0,display:"block",height:"auto"})},_fadeChangeBack:function(a,b,c,d){this._fadeChange(a,b,c,d)},_fadeChange:function(b,c,d,e){var f=this;b.fadeOut(d/2,function(){c.fadeIn(d/2,function(){e.call(f,a(this))})})},_removeClasses:function(){this._filterBar.removeClass(this.toThemeProperty("jqx-listmenu-filter")),this._filterBar.removeClass(this.toThemeProperty("jqx-widget-header")),this._filterInput.removeClass(this.toThemeProperty("jqx-listmenu-filter-input")),this._filterInput.removeClass(this.toThemeProperty("jqx-input")),this._header.removeClass(this.toThemeProperty("jqx-listmenu-header")),this._header.removeClass(this.toThemeProperty("jqx-widget-header")),this._header.removeClass(this.toThemeProperty("jqx-rc-t")),this.roundedCorners&&this.host.removeClass(this.toThemeProperty("jqx-rc-all")),this.host.removeClass(this.toThemeProperty("jqx-widget")),this.host.removeClass(this.toThemeProperty("jqx-listmenu-widget")),this.host.removeClass(this.toThemeProperty("jqx-fill-state-normal")),this.host.removeClass(this.toThemeProperty("jqx-reset")),this.host.find('div[data-role="content"]').length>0&&this.host.find('div[data-role="content"]').removeClass(this.toThemeProperty("jqx-widget-content"))},_addClasses:function(){this.roundedCorners?this.host.addClass(this.toThemeProperty("jqx-rc-all")):this.host.removeClass(this.toThemeProperty("jqx-rc-all")),this.host.addClass("jqx-widget"),this.host.addClass("jqx-listmenu-widget"),this.host.addClass("jqx-fill-state-normal"),this.host.addClass("jqx-reset"),this._filterBar.addClass(this.toThemeProperty("jqx-listmenu-filter")),this._filterBar.addClass(this.toThemeProperty("jqx-widget-header")),this._filterInput.addClass(this.toThemeProperty("jqx-listmenu-filter-input")),this._filterInput.addClass(this.toThemeProperty("jqx-input")),this._header.addClass(this.toThemeProperty("jqx-listmenu-header")),this._header.addClass(this.toThemeProperty("jqx-widget-header")),this._header.addClass(this.toThemeProperty("jqx-rc-t")),this.host.find('div[data-role="content"]').length>0&&this.host.find('div[data-role="content"]').addClass(this.toThemeProperty("jqx-widget-content"))},_raiseEvent:function(){},_filter:function(b){for(var c=this.host.find(".jqx-listmenu-item"),d=0;d<c.length;d+=1){var e=a.trim(a(c[d]).text());this.filterCallback(e,b)?c[d].style.display="block":c[d].style.display="none"}for(var c=this.host.find(".jqx-listmenu-separator"),d=0;d<c.length;d+=1){var f=!1;a.each(c[d].items,function(){if("none"!=a(this).css("display"))return f=!0,!1}),f?c[d].style.display="block":c[d].style.display="none"}},disable:function(){this.host.addClass(this.toThemeProperty("jqx-fill-state-disabled")),this.disabled=!0},enable:function(){this.host.removeClass(this.toThemeProperty("jqx-fill-state-disabled")),this.disabled=!1},propertyChangedHandler:function(a,b,c,d){if("disabled"==b&&(d?a.disable():a.enable()),"backLabel"===b)return void a._backButton.html(d);if("placeHolder"===b)a._filterInput.attr("placeholder",d);else if(/(showFilter|showHeader|showBackButton|width|height|autoSeparators|readOnly)/.test(b))return void a._render()}})}(jqxBaseFramework);
+

mercurial