www-thermferm/jqwidgets/jqxexpander.js

changeset 511
2d1d43c3a2c2
parent 373
f6850e0b5d35
child 617
b216f9d4b917
--- a/www-thermferm/jqwidgets/jqxexpander.js	Fri May 19 16:34:21 2017 +0200
+++ b/www-thermferm/jqwidgets/jqxexpander.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(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"]};a.extend(true,this,b);return b},createInstance:function(b){this._isTouchDevice=a.jqx.mobile.isTouchDevice();a.jqx.aria(this);this._cachedHTMLStructure=this.host.html();this.render()},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"));this._header.addClass(this.toThemeProperty("jqx-expander-header-expanded"));if(this.headerPosition=="top"){this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-down"));this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-down-hover"));this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-up-hover"));this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-down-selected"));this._arrow.removeClass(this.toThemeProperty("jqx-expander-arrow-top"));this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up"));this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up-selected"));this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-bottom"));this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-expanded"))}else{if(this.headerPosition=="bottom"){this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-up"));this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-up-selected"));this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-down-hover"));this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-up-hover"));this._arrow.removeClass(this.toThemeProperty("jqx-expander-arrow-bottom"));this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down"));this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-top"));this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-expanded-top"))}}switch(this.animationType){case"slide":if(this.headerPosition=="top"){this._content.slideDown(this.expandAnimationDuration,this.easing,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._content.css({display:"inherit",height:0});if(a.jqx.browser.msie&&a.jqx.browser.version<8){this._content.css("display","block")}if(this._cntntEmpty==true){this._content.animate({height:0},this.expandAnimationDuration,this.easing,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},this.expandAnimationDuration,this.easing,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(this.expandAnimationDuration,this.easing,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._content.css("display","inherit");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"));this._header.removeClass(this.toThemeProperty("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"));this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-up-selected"));this._arrow.removeClass(this.toThemeProperty("jqx-expander-arrow-bottom"));this._arrow.removeClass(this.toThemeProperty("jqx-expander-arrow-expanded"));this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down"));if(b._hovered){this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down-hover"))}this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-top"))}else{if(this.headerPosition=="bottom"){this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-down"));this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-down-selected"));this._arrow.removeClass(this.toThemeProperty("jqx-expander-arrow-top"));this._arrow.removeClass(this.toThemeProperty("jqx-expander-arrow-expanded-top"));this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up"));this._arrow.addClass(this.toThemeProperty("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(this.collapseAnimationDuration,this.easing,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},this.expandAnimationDuration,function(){b._content.css("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(this.collapseAnimationDuration,this.easing,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":this._content.css("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._header_text.html(b);this.invalidate()},getHeaderContent:function(){return this._header_text.html()},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._arrow.css("display","inherit")}else{this._arrow.css("display","none")}this._setTheme();this._setSize();if(this.disabled==false){this._toggle()}this._keyBoard()},render:function(){this.widgetID=this.element.id;if(this._header){this._header.removeClass(this.toThemeProperty("jqx-expander-header-content"));this._header.removeClass(this.toThemeProperty("jqx-expander-header"));this._header.removeClass(this.toThemeProperty("jqx-expander-header-expanded"));this._header.removeClass(this.toThemeProperty("jqx-widget-header"));this._header_text.removeClass(this.toThemeProperty("jqx-expander-header-content"));this._header_text.removeClass(this.toThemeProperty("jqx-expander-header"));this._header_text.removeClass(this.toThemeProperty("jqx-widget-header"));this._header_text.removeClass(this.toThemeProperty("jqx-expander-header-expanded"));this._header.attr("tabindex",null);this._content.attr("tabindex",null);this._header.css("margin-top",0);this._header[0].innerHTML=this._header_text[0].innerHTML;if(this.headerPosition=="bottom"){this._header.detach();this.host.prepend(this._header)}}this._header_temp=this.host.children("div:eq(0)");this._header_temp.wrap("<div></div>");this._header=this.host.children("div:eq(0)");this._content=this.host.children("div:eq(1)");if(this.headerPosition=="bottom"){this._header.detach();this.host.append(this._header)}this._header_text=this._header.children("div:eq(0)");var d=this._header_text[0].className;this._header.addClass(d);this._header_text.removeClass();if(!this.rtl){this._header_text.addClass(this.toThemeProperty("jqx-expander-header-content"))}else{this._header_text.addClass(this.toThemeProperty("jqx-expander-header-content-rtl"))}this._header.append("<div></div>");this._arrow=this._header.children("div:eq(1)");if(this.showArrow==true){this._arrow.css("display","inherit")}else{this._arrow.css("display","none")}this.tI=-1;if(this._header.attr("tabindex")==undefined){this.tI++;this._header.attr("tabindex",this.tI)}if(this._content.attr("tabindex")==undefined){this.tI++;this._content.attr("tabindex",this.tI)}this._setTheme();this._checkContent();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||this.host.children().length<2||this.host.children().length>2){throw b}}catch(c){alert(c)}this._expandChecker;this._initialized;if(this.expanded==true){if(this.headerPosition=="top"){this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up"));this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up-selected"));this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-bottom"));this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-expanded"))}else{if(this.headerPosition=="bottom"){this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down"));this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down-selected"));this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-top"));this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-expanded-top"))}}if(this.initContent){this._setSize();this.initContent()}this._initialized=true;this._expandChecker=0}else{if(this.expanded==false){this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-down-selected"));this._arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-up-selected"));if(this.headerPosition=="top"){this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down"));this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-top"))}else{if(this.headerPosition=="bottom"){this._arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up"));this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-bottom"))}}this._initialized=false;this._expandChecker=1;this._content.css("display","none")}}this._setSize();if(this.disabled==false){this._toggle()}this._keyBoard();var e=this;a.jqx.utilities.resize(this.host,function(){e.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._header.focus()}}catch(b){}},propertyChangedHandler:function(b,c,e,d){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;try{var b=this.host.trigger(f)}catch(d){}return b},resize:function(c,b){this.width=c;this.height=b;this._setSize()},_setSize:function(){this.host.width(this.width);this.host.height(this.height);this._header.height("auto");this._header.css("min-height",this._arrow.height());var c=this.arrowPosition;if(this.rtl){switch(c){case"left":c="right";break;case"right":c="left";break}}if(c=="right"){this._header_text.css({"float":"left","margin-left":"0px"});this._arrow.css({"float":"right",position:"relative"})}else{if(c=="left"){if(this.width=="auto"){this._header_text.css({"float":"left","margin-left":"17px"});this._arrow.css({"float":"left",position:"absolute"})}else{this._header_text.css({"float":"right","margin-left":"0px"});this._arrow.css({"float":"left",position:"relative"})}}}this._arrow.css("margin-top",this._header_text.height()/2-this._arrow.height()/2);if(this.height=="auto"){this._content.height("auto");this._contentHeight=this._content.height()}else{this._content.height("auto");var b=Math.round(this.host.height())-Math.round(this._header.outerHeight())-1;if(b<0){b=0}if(!this._contentHeight){this._contentHeight=this._content.height()}if(b!=this._contentHeight){this._content.height(b);this._contentHeight=Math.round(this._content.outerHeight())}else{this._content.height(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"));this._header.addClass(this.toThemeProperty("jqx-expander-header-hover"));if(this.headerPosition=="top"){this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-top-hover"));this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-down-hover"))}else{if(this.headerPosition=="bottom"){this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-bottom-hover"));this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow-up-hover"))}}}else{this.expand();this._header.removeClass(this.toThemeProperty("jqx-fill-state-hover"));this._header.removeClass(this.toThemeProperty("jqx-expander-header-hover"));if(this.headerPosition=="top"){this._arrow.removeClass(this.toThemeProperty("jqx-expander-arrow-top-hover"));this._arrow.removeClass(this.toThemeProperty("jqx-expander-arrow-down-hover"))}else{if(this.headerPosition=="bottom"){this._arrow.removeClass(this.toThemeProperty("jqx-expander-arrow-bottom-hover"));this._arrow.removeClass(this.toThemeProperty("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 b=this;this.host.addClass(this.toThemeProperty("jqx-widget"));this._header.addClass(this.toThemeProperty("jqx-widget-header"));this._content.addClass(this.toThemeProperty("jqx-widget-content"));if(this.rtl==true){this.host.addClass(this.toThemeProperty("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){this._header.addClass(this.toThemeProperty("jqx-fill-state-pressed"));this._header.addClass(this.toThemeProperty("jqx-expander-header-expanded"))}else{this._header.addClass(this.toThemeProperty("jqx-fill-state-normal"));this._header.removeClass(this.toThemeProperty("jqx-expander-header-expanded"))}this._hovered=false;if(!b._isTouchDevice){this.addHandler(this._header,"mouseenter.expander"+this.widgetID,function(){b._hovered=true;if(b._expandChecker==1){b._header.removeClass(b.toThemeProperty("jqx-fill-state-normal"));b._header.removeClass(b.toThemeProperty("jqx-fill-state-pressed"));b._header.addClass(b.toThemeProperty("jqx-fill-state-hover"));b._header.addClass(b.toThemeProperty("jqx-expander-header-hover"));if(b.headerPosition=="top"){if(b.expanded){b._arrow.addClass(b.toThemeProperty("jqx-icon-arrow-up-hover"))}else{b._arrow.addClass(b.toThemeProperty("jqx-icon-arrow-down-hover"))}b._arrow.addClass(b.toThemeProperty("jqx-expander-arrow-top-hover"));b._arrow.addClass(b.toThemeProperty("jqx-expander-arrow-down-hover"))}else{if(b.headerPosition=="bottom"){if(b.expanded){b._arrow.addClass(b.toThemeProperty("jqx-icon-arrow-down-hover"))}b._arrow.addClass(b.toThemeProperty("jqx-expander-arrow-bottom-hover"));b._arrow.addClass(b.toThemeProperty("jqx-expander-arrow-up-hover"))}}}});this.addHandler(this._header,"mouseleave.expander"+this.widgetID,function(){b._hovered=false;b._header.removeClass(b.toThemeProperty("jqx-fill-state-hover"));b._arrow.removeClass(b.toThemeProperty("jqx-icon-arrow-up-hover"));b._arrow.removeClass(b.toThemeProperty("jqx-icon-arrow-down-hover"));b._header.removeClass(b.toThemeProperty("jqx-expander-header-hover"));if(b.headerPosition=="top"){b._arrow.removeClass(b.toThemeProperty("jqx-expander-arrow-top-hover"));b._arrow.removeClass(b.toThemeProperty("jqx-expander-arrow-down-hover"))}else{if(b.headerPosition=="bottom"){b._arrow.removeClass(b.toThemeProperty("jqx-expander-arrow-bottom-hover"));b._arrow.removeClass(b.toThemeProperty("jqx-expander-arrow-up-hover"))}}if(b._expandChecker==1){b._header.addClass(b.toThemeProperty("jqx-fill-state-normal"))}else{b._header.addClass(b.toThemeProperty("jqx-fill-state-pressed"))}})}}else{this.host.addClass(this.toThemeProperty("jqx-fill-state-disabled"));this._header.addClass(this.toThemeProperty("jqx-expander-header-disabled"))}this.host.addClass(this.toThemeProperty("jqx-expander"));this._header.addClass(this.toThemeProperty("jqx-expander-header"));this._content.addClass(this.toThemeProperty("jqx-expander-content"));if(this.headerPosition=="top"){this._content.addClass(this.toThemeProperty("jqx-expander-content-bottom"))}else{if(this.headerPosition=="bottom"){this._content.addClass(this.toThemeProperty("jqx-expander-content-top"))}}this._arrow.addClass(this.toThemeProperty("jqx-expander-arrow"))},_checkContent:function(){this._cntntEmpty=/^\s*$/.test(this._content.html());if(this._cntntEmpty==true){this._content.height(0);this._content.addClass(this.toThemeProperty("jqx-expander-content-empty"))}else{this._content.height(this._contentHeight);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._header.focus()}d=true;break;case 40:if(c.ctrlKey==true&&b.focusedH==true){b._content.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._header_text,"focus.expander"+this.widgetID,function(){b._header.focus()});this.addHandler(this._arrow,"focus.expander"+this.widgetID,function(){b._header.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"))})}})})(jqxBaseFramework);
\ No newline at end of file
+*/
+!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);
+

mercurial