www-thermferm/jqwidgets/jqxexpander.js

changeset 617
b216f9d4b917
parent 511
2d1d43c3a2c2
--- a/www-thermferm/jqwidgets/jqxexpander.js	Sun Jul 10 16:58:40 2022 +0200
+++ b/www-thermferm/jqwidgets/jqxexpander.js	Mon Aug 08 10:54:27 2022 +0200
@@ -1,7 +1,9 @@
 /*
-jQWidgets v4.5.2 (2017-May)
-Copyright (c) 2011-2017 jQWidgets.
-License: http://jqwidgets.com/license/
-*/
-!function(a){"use strict";a.jqx.jqxWidget("jqxExpander","",{}),a.extend(a.jqx._jqxExpander.prototype,{defineInstance:function(){var b={width:"auto",height:"auto",expanded:!0,expandAnimationDuration:259,collapseAnimationDuration:250,animationType:"slide",toggleMode:"click",showArrow:!0,arrowPosition:"right",headerPosition:"top",disabled:!1,initContent:null,rtl:!1,easing:"easeInOutSine",aria:{"aria-disabled":{name:"disabled",type:"boolean"}},events:["expanding","expanded","collapsing","collapsed","resize"]};return this===a.jqx._jqxExpander.prototype?b:(a.extend(!0,this,b),b)},createInstance:function(){this._isTouchDevice=a.jqx.mobile.isTouchDevice(),a.jqx.aria(this),this._cachedHTMLStructure=this.host.html(),this._rendered=!1,this.render(),this._rendered=!0},expand:function(){if(this.disabled===!1&&this.expanded===!1&&1==this._expandChecker){var b=this;switch(this._expandChecker=0,this._raiseEvent("0"),this._header.removeClass(this.toThemeProperty("jqx-fill-state-normal")),this._header.addClass(this.toThemeProperty("jqx-fill-state-pressed jqx-expander-header-expanded")),"top"==this.headerPosition?(this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-down jqx-icon-arrow-down-hover jqx-icon-arrow-up-hover jqx-icon-arrow-down-selected jqx-expander-arrow-top")),this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up jqx-icon-arrow-up-selected jqx-expander-arrow-bottom jqx-expander-arrow-expanded"))):"bottom"==this.headerPosition&&(this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-up jqx-icon-arrow-up-selected jqx-icon-arrow-down-hover jqx-icon-arrow-up-hover jqx-expander-arrow-bottom")),this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down jqx-expander-arrow-top jqx-expander-arrow-expanded-top"))),this.animationType){case"slide":"top"==this.headerPosition?this._content.slideDown({duration:this.expandAnimationDuration,easing:this.easing,complete:function(){b.expanded=!0,a.jqx.aria(b._header,"aria-expanded",!0),a.jqx.aria(b._content,"aria-hidden",!1),b._raiseEvent("1"),b.initContent&&b._initialized===!1&&(b.initContent(),b._initialized=!0)}}):"bottom"==this.headerPosition&&(this._contentElement.style.display="",this._contentElement.style.height="0px",a.jqx.browser.msie&&a.jqx.browser.version<8&&(this._contentElement.style.display="block"),this._cntntEmpty===!0?this._content.animate({height:0},{duration:this.expandAnimationDuration,easing:this.easing,complete:function(){b.expanded=!0,a.jqx.aria(b._header,"aria-expanded",!0),a.jqx.aria(b._content,"aria-hidden",!1),b._raiseEvent("1"),b.initContent&&b._initialized===!1&&(b.initContent(),b._initialized=!0)}}):this._content.animate({height:this._contentHeight},{duration:this.expandAnimationDuration,easing:this.easing,complete:function(){b.expanded=!0,a.jqx.aria(b._header,"aria-expanded",!0),a.jqx.aria(b._content,"aria-hidden",!1),b._raiseEvent("1"),b.initContent&&b._initialized===!1&&(b.initContent(),b._initialized=!0)}}));break;case"fade":this._content.fadeIn({duration:this.expandAnimationDuration,easing:this.easing,complete:function(){b.expanded=!0,a.jqx.aria(b._header,"aria-expanded",!0),a.jqx.aria(b._content,"aria-hidden",!1),b._raiseEvent("1"),b.initContent&&b._initialized===!1&&(b.initContent(),b._initialized=!0)}});break;case"none":this._contentElement.style.display="",this.expanded=!0,a.jqx.aria(b._header,"aria-expanded",!0),a.jqx.aria(b._content,"aria-hidden",!1),this._raiseEvent("1"),this.initContent&&this._initialized===!1&&(this.initContent(),this._initialized=!0)}}},collapse:function(){if(this.disabled===!1&&this.expanded===!0&&0===this._expandChecker){var b=this;switch(this._expandChecker=1,this._raiseEvent("2"),this._header.removeClass(this.toThemeProperty("jqx-fill-state-pressed jqx-expander-header-expanded")),this._header.addClass(this.toThemeProperty("jqx-fill-state-normal")),"top"==this.headerPosition?(this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-up jqx-icon-arrow-up-selected jqx-expander-arrow-bottom jqx-expander-arrow-expanded")),this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down jqx-expander-arrow-top")),b._hovered&&this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down-hover"))):"bottom"==this.headerPosition&&(this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-down jqx-icon-arrow-down-selected jqx-expander-arrow-top jqx-expander-arrow-expanded-top")),this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up jqx-expander-arrow-bottom")),b._hovered&&this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up-hover"))),this.animationType){case"slide":"top"==this.headerPosition?this._content.slideUp({duration:this.collapseAnimationDuration,easing:this.easing,complete:function(){b.expanded=!1,a.jqx.aria(b._header,"aria-expanded",!1),a.jqx.aria(b._content,"aria-hidden",!0),b._raiseEvent("3")}}):"bottom"==this.headerPosition&&this._content.animate({height:0},{duration:this.expandAnimationDuration,easing:this.easing,complete:function(){b._contentElement.style.display="none",b.expanded=!1,a.jqx.aria(b._header,"aria-expanded",!1),a.jqx.aria(b._content,"aria-hidden",!0),b._raiseEvent("3")}});break;case"fade":this._content.fadeOut({duration:this.collapseAnimationDuration,easing:this.easing,complete:function(){b.expanded=!1,a.jqx.aria(b._header,"aria-expanded",!1),a.jqx.aria(b._content,"aria-hidden",!0),b._raiseEvent("3")}});break;case"none":b._contentElement.style.display="none",this.expanded=!1,a.jqx.aria(b._header,"aria-expanded",!1),a.jqx.aria(b._content,"aria-hidden",!0),this._raiseEvent("3")}}},setHeaderContent:function(a){this._headerText.innerHTML=a,this.invalidate()},getHeaderContent:function(){return this._headerText.innerHTML},setContent:function(a){this._content.html(a),this._checkContent(),this.invalidate()},getContent:function(){return this._content.html()},enable:function(){this.disabled=!1,this.refresh(),a.jqx.aria(this,"aria-disabled",!1)},disable:function(){this.disabled=!0,this.refresh(),a.jqx.aria(this,"aria-disabled",!0)},invalidate:function(){a.jqx.isHidden(this.host)||this._setSize()},refresh:function(a){a!==!0&&(this._removeHandlers(),this.showArrow===!0?this._arrowElement.style.display="":this._arrowElement.style.display="none",this._setTheme(),this._setSize(),this.disabled===!1&&this._toggle(),this._keyBoard())},render:function(){var b=this;if(b._rendered)return void b.refresh();this.widgetID=this.element.id;var c=this.host.children();this._headerText=c[0],this._headerElement=document.createElement("div"),this._header=a(this._headerElement),this._contentElement=c[1],this._content=a(this._contentElement),this._content.initAnimate&&this._content.initAnimate(),"top"===this.headerPosition?b.element.insertBefore(b._headerElement,b._headerText):b.element.appendChild(b._headerElement),b._headerElement.appendChild(b._headerText);var d=this._headerText.className;this._headerElement.className=d,this._headerText.className="",this.rtl?this._headerText.className+=" "+b.toThemeProperty("jqx-expander-header-content-rtl"):this._headerText.className+=" "+b.toThemeProperty("jqx-expander-header-content"),b._arrowElement=document.createElement("div"),b._headerElement.appendChild(b._arrowElement),this._arrow=a(b._arrowElement),this.showArrow===!0?b._arrowElement.style.display="":b._arrowElement.style.display="none",null===this._headerElement.getAttribute("tabindex")&&null===this._contentElement.getAttribute("tabindex")&&("top"===b.headerPosition?(this._headerElement.setAttribute("tabindex",1),this._contentElement.setAttribute("tabindex",2)):(this._headerElement.setAttribute("tabindex",2),this._contentElement.setAttribute("tabindex",1))),this._setTheme();var e="Invalid jqxExpander structure. Please add only two child div elements to your jqxExpander div that will represent the expander's header and content.";try{if(0===this._header.length||0===this._content.length||c.length<2||c.length>2)throw e}catch(a){throw new Error(a)}this._setSize(),this.expanded===!0?("top"==this.headerPosition?this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up jqx-icon-arrow-up-selected jqx-expander-arrow-bottom jqx-expander-arrow-expanded")):"bottom"==this.headerPosition&&this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down jqx-icon-arrow-down-selected jqx-expander-arrow-top jqx-expander-arrow-expanded-top")),this.initContent&&this.initContent(),this._initialized=!0,this._expandChecker=0):this.expanded===!1&&(this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-down-selected jqx-icon-arrow-up-selected")),"top"==this.headerPosition?this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down jqx-expander-arrow-top")):"bottom"==this.headerPosition&&this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up jqx-expander-arrow-bottom")),this._initialized=!1,this._expandChecker=1,this._contentElement.style.display="none"),this._checkContent(),this.disabled===!1&&this._toggle(),this._keyBoard(),a.jqx.utilities.resize(this.host,function(){b.invalidate()})},destroy:function(){this.removeHandler(a(window),"resize.expander"+this.widgetID),this.host.remove(),a(this.element).removeData("jqxExpander")},focus:function(){try{this.disabled===!1&&this._headerElement.focus()}catch(a){}},propertiesChangedHandler:function(a,b,c){c.width&&c.height&&2==Object.keys(c).length&&a._setSize()},propertyChangedHandler:function(a,b,c,d){if(!(a.batchUpdate&&a.batchUpdate.width&&a.batchUpdate.height&&2==Object.keys(a.batchUpdate).length))return"width"==b||"height"==b?void a._setSize():void("expanded"==b?d===!0&&c===!1?(this.expanded=!1,this.expand()):d===!1&&c===!0&&(this.expanded=!0,this.collapse()):this.refresh())},_raiseEvent:function(b,c){var d=this.events[b],e=new a.Event(d);e.owner=this,e.args=c;var f;try{f=this.host.trigger(e)}catch(a){}return f},resize:function(a,b){this.width=a,this.height=b,this._setSize()},_setSize:function(){this.element.style.width=this._toPx(this.width),this.element.style.height=this._toPx(this.height),this._headerElement.style.height="auto",this._headerElement.style.minHeight=this._arrowElement.offsetHeight;var a=this.arrowPosition;if(this.rtl)switch(a){case"left":a="right";break;case"right":a="left"}"right"==a?(this._headerText.style.float="left",this._headerText.style.marginLeft="0px",this._arrowElement.style.float="right",this._arrowElement.style.position="relative"):"left"==a&&("auto"==this.width?(this._headerText.style.float="left",this._headerText.style.marginLeft="17px",this._arrowElement.style.float="left",this._arrowElement.style.position="absolute"):(this._headerText.style.float="right",this._headerText.style.marginLeft="0px",this._arrowElement.style.float="left",this._arrowElement.style.position="relative")),this._arrowElement.style.marginTop=this._headerText.offsetHeight/2-this._arrowElement.offsetHeight/2+"px",this._contentElement.style.height="auto";var b=Math.max(0,this._content.height());if("auto"==this.height)this._contentHeight=b;else{var c=Math.round(this.element.offsetHeight)-Math.round(this._header.outerHeight())-1;c<0&&(c=0),this._contentHeight||(this._contentHeight=b),c!=this._contentHeight?(this._contentElement.style.height=this._toPx(c),this._contentHeight=Math.round(this._content.outerHeight())):this._contentElement.style.height=this._toPx(this._contentHeight)}},_toggle:function(){var b=this;if(this._isTouchDevice===!1)switch(this._header.removeClass(this.toThemeProperty("jqx-expander-header-disabled")),this.toggleMode){case"click":this.addHandler(this._header,"click.expander"+this.widgetID,function(){b._animate()});break;case"dblclick":this.addHandler(this._header,"dblclick.expander"+this.widgetID,function(){b._animate()});break;case"none":this._header.addClass(this.toThemeProperty("jqx-expander-header-disabled"))}else{if("none"==this.toggleMode)return;this.addHandler(this._header,a.jqx.mobile.getTouchEventName("touchstart")+"."+this.widgetID,function(){b._animate()})}},_animate:function(){this.expanded===!0?(this.collapse(),this._header.addClass(this.toThemeProperty("jqx-fill-state-hover jqx-expander-header-hover")),"top"==this.headerPosition?this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-top-hover jqx-expander-arrow-down-hover")):"bottom"==this.headerPosition&&this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-bottom-hover jqx-expander-arrow-up-hover"))):(this.expand(),this._header.removeClass(this.toThemeProperty("jqx-fill-state-hover jqx-expander-header-hover")),"top"==this.headerPosition?this._arrow.removeClass(this.toThemeProperty("jqx-expander-arrow-top-hover jqx-expander-arrow-down-hover")):"bottom"==this.headerPosition&&this._arrow.removeClass(this.toThemeProperty("jqx-expander-arrow-bottom-hover jqx-expander-arrow-up-hover")))},_removeHandlers:function(){this.removeHandler(this._header,"click.expander"+this.widgetID),this.removeHandler(this._header,"dblclick.expander"+this.widgetID),this.removeHandler(this._header,"mouseenter.expander"+this.widgetID),this.removeHandler(this._header,"mouseleave.expander"+this.widgetID)},_setTheme:function(){var a=this,b="jqx-widget jqx-expander",c="jqx-widget-header jqx-expander-header",d="jqx-widget-content jqx-expander-content";this.rtl===!0&&(b+=" jqx-rtl"),this.disabled===!1?(this._header.removeClass(this.toThemeProperty("jqx-expander-header-disabled")),this.host.removeClass(this.toThemeProperty("jqx-fill-state-disabled")),this.expanded===!0?c+=" jqx-fill-state-pressed jqx-expander-header-expanded":(c+=" jqx-fill-state-normal",this._header.removeClass(this.toThemeProperty("jqx-expander-header-expanded"))),this._hovered=!1,a._isTouchDevice||(this.addHandler(this._header,"mouseenter.expander"+this.widgetID,function(){a._hovered=!0,1==a._expandChecker&&(a._header.removeClass(a.toThemeProperty("jqx-fill-state-normal jqx-fill-state-pressed")),a._header.addClass(a.toThemeProperty("jqx-fill-state-hover jqx-expander-header-hover")),"top"==a.headerPosition?(a.expanded?a._arrow.addClass(a.toThemeProperty("jqx-icon-arrow-up-hover")):a._arrow.addClass(a.toThemeProperty("jqx-icon-arrow-down-hover")),a._arrow.addClass(a.toThemeProperty("jqx-expander-arrow-top-hover jqx-expander-arrow-down-hover"))):"bottom"==a.headerPosition&&(a.expanded&&a._arrow.addClass(a.toThemeProperty("jqx-icon-arrow-down-hover")),a._arrow.addClass(a.toThemeProperty("jqx-expander-arrow-bottom-hover jqx-expander-arrow-up-hover"))))}),this.addHandler(this._header,"mouseleave.expander"+this.widgetID,function(){a._hovered=!1,a._header.removeClass(a.toThemeProperty("jqx-fill-state-hover jqx-expander-header-hover")),a._arrow.removeClass(a.toThemeProperty("jqx-icon-arrow-up-hover jqx-icon-arrow-down-hover")),"top"==a.headerPosition?a._arrow.removeClass(a.toThemeProperty("jqx-expander-arrow-top-hover jqx-expander-arrow-down-hover")):"bottom"==a.headerPosition&&a._arrow.removeClass(a.toThemeProperty("jqx-expander-arrow-bottom-hover jqx-expander-arrow-up-hover")),1==a._expandChecker?a._header.addClass(a.toThemeProperty("jqx-fill-state-normal")):a._header.addClass(a.toThemeProperty("jqx-fill-state-pressed"))}))):(b+=" jqx-fill-state-disabled",c+=" jqx-expander-header-disabled"),"top"==this.headerPosition?d+=" jqx-expander-content-bottom":"bottom"==this.headerPosition&&(d+=" jqx-expander-content-top"),this.host.addClass(this.toThemeProperty(b)),this._header.addClass(this.toThemeProperty(c)),this._content.addClass(this.toThemeProperty(d)),this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow"))},_checkContent:function(){this._cntntEmpty=/^\s*$/.test(this._contentElement.innerHTML),this._cntntEmpty===!0?(this._contentElement.style.height="0px",this._content.addClass(this.toThemeProperty("jqx-expander-content-empty"))):("auto"===this.height?this._contentElement.style.height="auto":this._contentElement.style.height=this._contentHeight+"px",this._content.removeClass(this.toThemeProperty("jqx-expander-content-empty")))},_keyBoard:function(){var a=this;this._focus(),this.addHandler(this.host,"keydown.expander"+this.widgetID,function(b){var c=!1;if((a.focusedH===!0||a.focusedC===!0)&&a.disabled===!1){switch(b.keyCode){case 13:case 32:"none"!=a.toggleMode&&(a.focusedH===!0&&a._animate(),c=!0);break;case 38:b.ctrlKey===!0&&a.focusedC===!0&&a._headerElement.focus(),c=!0;break;case 40:b.ctrlKey===!0&&a.focusedH===!0&&a._contentElement.focus(),c=!0}return!0}return c&&b.preventDefault&&b.preventDefault(),!c})},_focus:function(){var b=this;this.addHandler(this._header,"focus.expander"+this.widgetID,function(){b.focusedH=!0,a.jqx.aria(b._header,"aria-selected",!0),b._header.addClass(b.toThemeProperty("jqx-fill-state-focus"))}),this.addHandler(this._header,"blur.expander"+this.widgetID,function(){b.focusedH=!1,a.jqx.aria(b._header,"aria-selected",!1),b._header.removeClass(b.toThemeProperty("jqx-fill-state-focus"))}),this.addHandler(this._headerText,"focus.expander"+this.widgetID,function(){b._headerElement.focus()}),this.addHandler(this._arrow,"focus.expander"+this.widgetID,function(){b._headerElement.focus()}),this.addHandler(this._content,"focus.expander"+this.widgetID,function(){b.focusedC=!0,b._content.addClass(b.toThemeProperty("jqx-fill-state-focus"))}),this.addHandler(this._content,"blur.expander"+this.widgetID,function(){b.focusedC=!1,b._content.removeClass(b.toThemeProperty("jqx-fill-state-focus"))})},_toPx:function(a){return"number"==typeof a?a+"px":a}})}(jqxBaseFramework);
-
+jQWidgets v12.0.1 (2021-Mar)
+Copyright (c) 2011-2021 jQWidgets.
+License: https://jqwidgets.com/license/
+*/
+/* eslint-disable */
+
+(function(a){a.jqx.jqxWidget("jqxExpander","",{});a.extend(a.jqx._jqxExpander.prototype,{defineInstance:function(){var b={width:"auto",height:"auto",expanded:true,expandAnimationDuration:259,collapseAnimationDuration:250,animationType:"slide",toggleMode:"click",showArrow:true,arrowPosition:"right",headerPosition:"top",disabled:false,initContent:null,rtl:false,easing:"easeInOutSine",aria:{"aria-disabled":{name:"disabled",type:"boolean"}},events:["expanding","expanded","collapsing","collapsed","resize"]};if(this===a.jqx._jqxExpander.prototype){return b}a.extend(true,this,b);return b},createInstance:function(){this._isTouchDevice=a.jqx.mobile.isTouchDevice();a.jqx.aria(this);this._cachedHTMLStructure=this.host.html();this._rendered=false;this.render();this._rendered=true},expand:function(){if(this.disabled===false&&this.expanded===false&&this._expandChecker==1){var b=this;this._expandChecker=0;this._raiseEvent("0");this._header.removeClass(this.toThemeProperty("jqx-fill-state-normal"));this._header.addClass(this.toThemeProperty("jqx-fill-state-pressed jqx-expander-header-expanded"));if(this.headerPosition=="top"){this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-down jqx-icon-arrow-down-hover jqx-icon-arrow-up-hover jqx-icon-arrow-down-selected jqx-expander-arrow-top"));this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up jqx-icon-arrow-up-selected jqx-expander-arrow-bottom jqx-expander-arrow-expanded"))}else{if(this.headerPosition=="bottom"){this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-up jqx-icon-arrow-up-selected jqx-icon-arrow-down-hover jqx-icon-arrow-up-hover jqx-expander-arrow-bottom"));this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down jqx-expander-arrow-top jqx-expander-arrow-expanded-top"))}}switch(this.animationType){case"slide":if(this.headerPosition=="top"){this._content.slideDown({duration:this.expandAnimationDuration,easing:this.easing,complete:function(){b.expanded=true;a.jqx.aria(b._header,"aria-expanded",true);a.jqx.aria(b._content,"aria-hidden",false);b._raiseEvent("1");if(b.initContent&&b._initialized===false){b.initContent();b._initialized=true}}})}else{if(this.headerPosition=="bottom"){this._contentElement.style.display="";this._contentElement.style.height="0px";if(a.jqx.browser.msie&&a.jqx.browser.version<8){this._contentElement.style.display="block"}if(this._cntntEmpty===true){this._content.animate({height:0},{duration:this.expandAnimationDuration,easing:this.easing,complete:function(){b.expanded=true;a.jqx.aria(b._header,"aria-expanded",true);a.jqx.aria(b._content,"aria-hidden",false);b._raiseEvent("1");if(b.initContent&&b._initialized===false){b.initContent();b._initialized=true}}})}else{this._content.animate({height:this._contentHeight},{duration:this.expandAnimationDuration,easing:this.easing,complete:function(){b.expanded=true;a.jqx.aria(b._header,"aria-expanded",true);a.jqx.aria(b._content,"aria-hidden",false);b._raiseEvent("1");if(b.initContent&&b._initialized===false){b.initContent();b._initialized=true}}})}}}break;case"fade":this._content.fadeIn({duration:this.expandAnimationDuration,easing:this.easing,complete:function(){b.expanded=true;a.jqx.aria(b._header,"aria-expanded",true);a.jqx.aria(b._content,"aria-hidden",false);b._raiseEvent("1");if(b.initContent&&b._initialized===false){b.initContent();b._initialized=true}}});break;case"none":this._contentElement.style.display="";this.expanded=true;a.jqx.aria(b._header,"aria-expanded",true);a.jqx.aria(b._content,"aria-hidden",false);this._raiseEvent("1");if(this.initContent&&this._initialized===false){this.initContent();this._initialized=true}break}}},collapse:function(){if(this.disabled===false&&this.expanded===true&&this._expandChecker===0){var b=this;this._expandChecker=1;this._raiseEvent("2");this._header.removeClass(this.toThemeProperty("jqx-fill-state-pressed jqx-expander-header-expanded"));this._header.addClass(this.toThemeProperty("jqx-fill-state-normal"));if(this.headerPosition=="top"){this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-up jqx-icon-arrow-up-selected jqx-expander-arrow-bottom jqx-expander-arrow-expanded"));this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down jqx-expander-arrow-top"));if(b._hovered){this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down-hover"))}}else{if(this.headerPosition=="bottom"){this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-down jqx-icon-arrow-down-selected jqx-expander-arrow-top jqx-expander-arrow-expanded-top"));this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up jqx-expander-arrow-bottom"));if(b._hovered){this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up-hover"))}}}switch(this.animationType){case"slide":if(this.headerPosition=="top"){this._content.slideUp({duration:this.collapseAnimationDuration,easing:this.easing,complete:function(){b.expanded=false;a.jqx.aria(b._header,"aria-expanded",false);a.jqx.aria(b._content,"aria-hidden",true);b._raiseEvent("3")}})}else{if(this.headerPosition=="bottom"){this._content.animate({height:0},{duration:this.expandAnimationDuration,easing:this.easing,complete:function(){b._contentElement.style.display="none";b.expanded=false;a.jqx.aria(b._header,"aria-expanded",false);a.jqx.aria(b._content,"aria-hidden",true);b._raiseEvent("3")}})}}break;case"fade":this._content.fadeOut({duration:this.collapseAnimationDuration,easing:this.easing,complete:function(){b.expanded=false;a.jqx.aria(b._header,"aria-expanded",false);a.jqx.aria(b._content,"aria-hidden",true);b._raiseEvent("3")}});break;case"none":b._contentElement.style.display="none";this.expanded=false;a.jqx.aria(b._header,"aria-expanded",false);a.jqx.aria(b._content,"aria-hidden",true);this._raiseEvent("3");break}}},setHeaderContent:function(b){this._headerText.innerHTML=b;this.invalidate()},getHeaderContent:function(){return this._headerText.innerHTML},setContent:function(b){this._content.html(b);this._checkContent();this.invalidate()},getContent:function(){return this._content.html()},enable:function(){this.disabled=false;this.refresh();a.jqx.aria(this,"aria-disabled",false)},disable:function(){this.disabled=true;this.refresh();a.jqx.aria(this,"aria-disabled",true)},invalidate:function(){if(a.jqx.isHidden(this.host)){return}this._setSize()},refresh:function(b){if(b===true){return}this._removeHandlers();if(this.showArrow===true){this._arrowElement.style.display=""}else{this._arrowElement.style.display="none"}this._setTheme();this._setSize();if(this.disabled===false){this._toggle()}this._keyBoard()},render:function(){var f=this;if(f._rendered){f.refresh();return}this.widgetID=this.element.id;var e=this.host.children();this._headerText=e[0];this._headerElement=document.createElement("div");this._header=a(this._headerElement);this._contentElement=e[1];this._content=a(this._contentElement);if(this._content.initAnimate){this._content.initAnimate()}if(this.headerPosition==="top"){f.element.insertBefore(f._headerElement,f._headerText)}else{f.element.appendChild(f._headerElement)}f._headerElement.appendChild(f._headerText);var d=this._headerText.className;this._headerElement.className=d;this._headerText.className="";if(!this.rtl){this._headerText.className+=" "+f.toThemeProperty("jqx-expander-header-content")}else{this._headerText.className+=" "+f.toThemeProperty("jqx-expander-header-content-rtl")}f._arrowElement=document.createElement("div");f._headerElement.appendChild(f._arrowElement);this._arrow=a(f._arrowElement);if(this.showArrow===true){f._arrowElement.style.display=""}else{f._arrowElement.style.display="none"}if(this._headerElement.getAttribute("tabindex")===null&&this._contentElement.getAttribute("tabindex")===null){if(f.headerPosition==="top"){this._headerElement.setAttribute("tabindex",1);this._contentElement.setAttribute("tabindex",2)}else{this._headerElement.setAttribute("tabindex",2);this._contentElement.setAttribute("tabindex",1)}}this._setTheme();var b="Invalid jqxExpander structure. Please add only two child div elements to your jqxExpander div that will represent the expander's header and content.";try{if(this._header.length===0||this._content.length===0||e.length<2||e.length>2){throw b}}catch(c){throw new Error(c)}this._setSize();if(this.expanded===true){if(this.headerPosition=="top"){this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up jqx-icon-arrow-up-selected jqx-expander-arrow-bottom jqx-expander-arrow-expanded"))}else{if(this.headerPosition=="bottom"){this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down jqx-icon-arrow-down-selected jqx-expander-arrow-top jqx-expander-arrow-expanded-top"))}}if(this.initContent){this.initContent()}this._initialized=true;this._expandChecker=0}else{if(this.expanded===false){this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-down-selected jqx-icon-arrow-up-selected"));if(this.headerPosition=="top"){this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down jqx-expander-arrow-top"))}else{if(this.headerPosition=="bottom"){this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up jqx-expander-arrow-bottom"))}}this._initialized=false;this._expandChecker=1;this._contentElement.style.display="none"}}this._checkContent();if(this.disabled===false){this._toggle()}this._keyBoard();a.jqx.utilities.resize(this.host,function(){f.invalidate()})},destroy:function(){this.removeHandler(a(window),"resize.expander"+this.widgetID);this.host.remove();a(this.element).removeData("jqxExpander")},focus:function(){try{if(this.disabled===false){this._headerElement.focus()}}catch(b){}},propertiesChangedHandler:function(b,c,d){if(d.width&&d.height&&Object.keys(d).length==2){b._setSize()}},propertyChangedHandler:function(b,c,e,d){if(b.batchUpdate&&b.batchUpdate.width&&b.batchUpdate.height&&Object.keys(b.batchUpdate).length==2){return}if(c=="width"||c=="height"){b._setSize();return}if(c=="expanded"){if(d===true&&e===false){this.expanded=false;this.expand()}else{if(d===false&&e===true){this.expanded=true;this.collapse()}}}else{this.refresh()}},_raiseEvent:function(g,e){var c=this.events[g];var f=new a.Event(c);f.owner=this;f.args=e;var b;try{b=this.host.trigger(f)}catch(d){}return b},resize:function(c,b){this.width=c;this.height=b;this._setSize()},_setSize:function(){this.element.style.width=this._toPx(this.width);this.element.style.height=this._toPx(this.height);this._headerElement.style.height="auto";this._headerElement.style.minHeight=this._arrowElement.offsetHeight;var d=this.arrowPosition;if(this.rtl){switch(d){case"left":d="right";break;case"right":d="left";break}}if(d=="right"){this._headerText.style["float"]="left";this._headerText.style.marginLeft="0px";this._arrowElement.style["float"]="right";this._arrowElement.style.position="relative"}else{if(d=="left"){if(this.width=="auto"){this._headerText.style["float"]="left";this._headerText.style.marginLeft="17px";this._arrowElement.style["float"]="left";this._arrowElement.style.position="absolute"}else{this._headerText.style["float"]="right";this._headerText.style.marginLeft="0px";this._arrowElement.style["float"]="left";this._arrowElement.style.position="relative"}}}this._arrowElement.style.marginTop=(this._headerText.offsetHeight/2-this._arrowElement.offsetHeight/2)+"px";this._contentElement.style.height="auto";var c=Math.max(0,this._content.height());if(this.height=="auto"){this._contentHeight=c}else{var b=Math.round(this.element.offsetHeight)-Math.round(this._header.outerHeight())-1;if(b<0){b=0}if(!this._contentHeight){this._contentHeight=c}if(b!=this._contentHeight){this._contentElement.style.height=this._toPx(b);this._contentHeight=Math.round(this._content.outerHeight())}else{this._contentElement.style.height=this._toPx(this._contentHeight)}}},_toggle:function(){var b=this;if(this._isTouchDevice===false){this._header.removeClass(this.toThemeProperty("jqx-expander-header-disabled"));switch(this.toggleMode){case"click":this.addHandler(this._header,"click.expander"+this.widgetID,function(){b._animate()});break;case"dblclick":this.addHandler(this._header,"dblclick.expander"+this.widgetID,function(){b._animate()});break;case"none":this._header.addClass(this.toThemeProperty("jqx-expander-header-disabled"));break}}else{if(this.toggleMode!="none"){this.addHandler(this._header,a.jqx.mobile.getTouchEventName("touchstart")+"."+this.widgetID,function(){b._animate()})}else{return}}},_animate:function(){if(this.expanded===true){this.collapse();this._header.addClass(this.toThemeProperty("jqx-fill-state-hover jqx-expander-header-hover"));if(this.headerPosition=="top"){this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-top-hover jqx-expander-arrow-down-hover"))}else{if(this.headerPosition=="bottom"){this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-bottom-hover jqx-expander-arrow-up-hover"))}}}else{this.expand();this._header.removeClass(this.toThemeProperty("jqx-fill-state-hover jqx-expander-header-hover"));if(this.headerPosition=="top"){this._arrow.removeClass(this.toThemeProperty("jqx-expander-arrow-top-hover jqx-expander-arrow-down-hover"))}else{if(this.headerPosition=="bottom"){this._arrow.removeClass(this.toThemeProperty("jqx-expander-arrow-bottom-hover jqx-expander-arrow-up-hover"))}}}},_removeHandlers:function(){this.removeHandler(this._header,"click.expander"+this.widgetID);this.removeHandler(this._header,"dblclick.expander"+this.widgetID);this.removeHandler(this._header,"mouseenter.expander"+this.widgetID);this.removeHandler(this._header,"mouseleave.expander"+this.widgetID)},_setTheme:function(){var e=this,b="jqx-widget jqx-expander",d="jqx-widget-header jqx-expander-header",c="jqx-widget-content jqx-expander-content";if(this.rtl===true){b+=" jqx-rtl"}if(this.disabled===false){this._header.removeClass(this.toThemeProperty("jqx-expander-header-disabled"));this.host.removeClass(this.toThemeProperty("jqx-fill-state-disabled"));if(this.expanded===true){d+=" jqx-fill-state-pressed jqx-expander-header-expanded"}else{d+=" jqx-fill-state-normal";this._header.removeClass(this.toThemeProperty("jqx-expander-header-expanded"))}this._hovered=false;if(!e._isTouchDevice){this.addHandler(this._header,"mouseenter.expander"+this.widgetID,function(){e._hovered=true;if(e._expandChecker==1){e._header.removeClass(e.toThemeProperty("jqx-fill-state-normal jqx-fill-state-pressed"));e._header.addClass(e.toThemeProperty("jqx-fill-state-hover jqx-expander-header-hover"));if(e.headerPosition=="top"){if(e.expanded){e._arrow.addClass(e.toThemeProperty("jqx-icon-arrow-up-hover"))}else{e._arrow.addClass(e.toThemeProperty("jqx-icon-arrow-down-hover"))}e._arrow.addClass(e.toThemeProperty("jqx-expander-arrow-top-hover jqx-expander-arrow-down-hover"))}else{if(e.headerPosition=="bottom"){if(e.expanded){e._arrow.addClass(e.toThemeProperty("jqx-icon-arrow-down-hover"))}e._arrow.addClass(e.toThemeProperty("jqx-expander-arrow-bottom-hover jqx-expander-arrow-up-hover"))}}}});this.addHandler(this._header,"mouseleave.expander"+this.widgetID,function(){e._hovered=false;e._header.removeClass(e.toThemeProperty("jqx-fill-state-hover jqx-expander-header-hover"));e._arrow.removeClass(e.toThemeProperty("jqx-icon-arrow-up-hover jqx-icon-arrow-down-hover"));if(e.headerPosition=="top"){e._arrow.removeClass(e.toThemeProperty("jqx-expander-arrow-top-hover jqx-expander-arrow-down-hover"))}else{if(e.headerPosition=="bottom"){e._arrow.removeClass(e.toThemeProperty("jqx-expander-arrow-bottom-hover jqx-expander-arrow-up-hover"))}}if(e._expandChecker==1){e._header.addClass(e.toThemeProperty("jqx-fill-state-normal"))}else{e._header.addClass(e.toThemeProperty("jqx-fill-state-pressed"))}})}}else{b+=" jqx-fill-state-disabled";d+=" jqx-expander-header-disabled"}if(this.headerPosition=="top"){c+=" jqx-expander-content-bottom"}else{if(this.headerPosition=="bottom"){c+=" jqx-expander-content-top"}}this.host.addClass(this.toThemeProperty(b));this._header.addClass(this.toThemeProperty(d));this._content.addClass(this.toThemeProperty(c));this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow"))},_checkContent:function(){this._cntntEmpty=/^\s*$/.test(this._contentElement.innerHTML);if(this._cntntEmpty===true){this._contentElement.style.height="0px";this._content.addClass(this.toThemeProperty("jqx-expander-content-empty"))}else{if(this.height==="auto"){this._contentElement.style.height="auto"}else{this._contentElement.style.height=this._contentHeight+"px"}this._content.removeClass(this.toThemeProperty("jqx-expander-content-empty"))}},_keyBoard:function(){var b=this;this._focus();this.addHandler(this.host,"keydown.expander"+this.widgetID,function(c){var d=false;if((b.focusedH===true||b.focusedC===true)&&b.disabled===false){switch(c.keyCode){case 13:case 32:if(b.toggleMode!="none"){if(b.focusedH===true){b._animate()}d=true}break;case 38:if(c.ctrlKey===true&&b.focusedC===true){b._headerElement.focus()}d=true;break;case 40:if(c.ctrlKey===true&&b.focusedH===true){b._contentElement.focus()}d=true;break}return true}if(d&&c.preventDefault){c.preventDefault()}return !d})},_focus:function(){var b=this;this.addHandler(this._header,"focus.expander"+this.widgetID,function(){b.focusedH=true;a.jqx.aria(b._header,"aria-selected",true);b._header.addClass(b.toThemeProperty("jqx-fill-state-focus"))});this.addHandler(this._header,"blur.expander"+this.widgetID,function(){b.focusedH=false;a.jqx.aria(b._header,"aria-selected",false);b._header.removeClass(b.toThemeProperty("jqx-fill-state-focus"))});this.addHandler(this._headerText,"focus.expander"+this.widgetID,function(){b._headerElement.focus()});this.addHandler(this._arrow,"focus.expander"+this.widgetID,function(){b._headerElement.focus()});this.addHandler(this._content,"focus.expander"+this.widgetID,function(){b.focusedC=true;b._content.addClass(b.toThemeProperty("jqx-fill-state-focus"))});this.addHandler(this._content,"blur.expander"+this.widgetID,function(){b.focusedC=false;b._content.removeClass(b.toThemeProperty("jqx-fill-state-focus"))})},_toPx:function(b){if(typeof b==="number"){return b+"px"}else{return b}}})})(jqxBaseFramework);
+

mercurial