www-thermferm/jqwidgets/jqxdropdownbutton.js

changeset 511
2d1d43c3a2c2
parent 373
f6850e0b5d35
child 617
b216f9d4b917
--- a/www-thermferm/jqwidgets/jqxdropdownbutton.js	Fri May 19 16:34:21 2017 +0200
+++ b/www-thermferm/jqwidgets/jqxdropdownbutton.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("jqxDropDownButton","",{});a.extend(a.jqx._jqxDropDownButton.prototype,{defineInstance:function(){var b={disabled:false,width:null,height:null,arrowSize:19,enableHover:true,openDelay:250,closeDelay:300,animationType:"default",enableBrowserBoundsDetection:false,dropDownHorizontalAlignment:"left",popupZIndex:20000,autoOpen:false,rtl:false,initContent:null,dropDownWidth:null,dropDownHeight:null,focusable:true,touchMode:false,aria:{"aria-disabled":{name:"disabled",type:"boolean"}},events:["open","close","opening","closing"]};a.extend(true,this,b);return b},createInstance:function(j){var g=this;if(!g.width){g.width=200}if(!g.height){g.height=25}g.isanimating=false;g.setupInstance();var c=a("<div style='background-color: transparent; -webkit-appearance: none; outline: none; width:100%; height: 100%; padding: 0px; margin: 0px; border: 0px; position: relative;'><div id='dropDownButtonWrapper' style='outline: none; background-color: transparent; border: none; float: left; width:100%; height: 100%; position: relative;'><div id='dropDownButtonContent' unselectable='on' style='outline: none; background-color: transparent; border: none; float: left; position: relative;'/><div id='dropDownButtonArrow' unselectable='on'  style='background-color: transparent; border: none; float: right; position: relative;'><div unselectable='on'></div></div></div></div>");if(g.host.attr("tabindex")){c.attr("tabindex",g.host.attr("tabindex"));g.host.removeAttr("tabindex")}else{c.attr("tabindex",0)}if(!g.focusable){c.removeAttr("tabIndex")}a.jqx.aria(this);g.popupContent=g.host.children();g.host.attr("role","button");if(g.popupContent.length==0){g.popupContent=a("<div>"+g.host.text()+"</div>");g.popupContent.css("display","block");g.element.innerHTML=""}else{g.popupContent.detach()}var k=this;g.addHandler(g.host,"loadContent",function(e){k._arrange()});try{var f="dropDownButtonPopup"+g.element.id;var d=a(a.find("#"+f));if(d.length>0){d.remove()}a.jqx.aria(this,"aria-haspopup",true);a.jqx.aria(this,"aria-owns",f);var b=a("<div class='dropDownButton' style='overflow: hidden; left: 0px; top: 0px; position: absolute;' id='dropDownButtonPopup"+g.element.id+"'></div>");b.addClass(g.toThemeProperty("jqx-widget-content"));b.addClass(g.toThemeProperty("jqx-dropdownbutton-popup"));b.addClass(g.toThemeProperty("jqx-popup"));b.addClass(g.toThemeProperty("jqx-rc-all"));b.css("z-index",g.popupZIndex);if(a.jqx.browser.msie){b.addClass(g.toThemeProperty("jqx-noshadow"))}g.popupContent.appendTo(b);b.appendTo(document.body);g.container=b;g.container.css("visibility","hidden")}catch(h){}g.touch=a.jqx.mobile.isTouchDevice();g.dropDownButtonStructure=c;g.host.append(c);g.dropDownButtonWrapper=g.host.find("#dropDownButtonWrapper");g.firstDiv=g.dropDownButtonWrapper.parent();g.dropDownButtonArrow=g.host.find("#dropDownButtonArrow");g.arrow=a(g.dropDownButtonArrow.children()[0]);g.dropDownButtonContent=g.host.find("#dropDownButtonContent");g.dropDownButtonContent.addClass(g.toThemeProperty("jqx-dropdownlist-content"));g.dropDownButtonWrapper.addClass(g.toThemeProperty("jqx-disableselect"));if(g.rtl){g.dropDownButtonContent.addClass(g.toThemeProperty("jqx-rtl"))}var m=this;if(g.host.parents()){g.addHandler(g.host.parents(),"scroll.dropdownbutton"+g.element.id,function(e){var n=m.isOpened();if(n){m.close()}})}g.addHandler(g.dropDownButtonWrapper,"selectstart",function(){return false});g.dropDownButtonWrapper[0].id="dropDownButtonWrapper"+g.element.id;g.dropDownButtonArrow[0].id="dropDownButtonArrow"+g.element.id;g.dropDownButtonContent[0].id="dropDownButtonContent"+g.element.id;var m=this;g.propertyChangeMap.disabled=function(e,o,n,p){if(p){e.host.addClass(m.toThemeProperty("jqx-dropdownlist-state-disabled"));e.host.addClass(m.toThemeProperty("jqx-fill-state-disabled"));e.dropDownButtonContent.addClass(m.toThemeProperty("jqx-dropdownlist-content-disabled"))}else{e.host.removeClass(m.toThemeProperty("jqx-dropdownlist-state-disabled"));e.host.removeClass(m.toThemeProperty("jqx-fill-state-disabled"));e.dropDownButtonContent.removeClass(m.toThemeProperty("jqx-dropdownlist-content-disabled"))}a.jqx.aria(e,"aria-disabled",e.disabled)};if(g.disabled){g.host.addClass(g.toThemeProperty("jqx-dropdownlist-state-disabled"));g.host.addClass(g.toThemeProperty("jqx-fill-state-disabled"));g.dropDownButtonContent.addClass(g.toThemeProperty("jqx-dropdownlist-content-disabled"))}var i=g.toThemeProperty("jqx-rc-all")+" "+g.toThemeProperty("jqx-fill-state-normal")+" "+g.toThemeProperty("jqx-widget")+" "+g.toThemeProperty("jqx-widget-content")+" "+g.toThemeProperty("jqx-dropdownlist-state-normal");g.host.addClass(i);g.arrow.addClass(g.toThemeProperty("jqx-icon-arrow-down"));g.arrow.addClass(g.toThemeProperty("jqx-icon"));g._setSize();g.render();if(a.jqx.browser.msie&&a.jqx.browser.version<8){g.container.css("display","none");if(g.host.parents(".jqx-window").length>0){var l=g.host.parents(".jqx-window").css("z-index");b.css("z-index",l+10);g.container.css("z-index",l+10)}}},setupInstance:function(){var c=this;var b={setContent:function(d){c.dropDownButtonContent.children().remove();c.dropDownButtonContent[0].innerHTML="";c.dropDownButtonContent.append(d)},val:function(d){if(arguments.length==0||typeof(d)=="object"){return c.dropDownButtonContent.text()}else{c.dropDownButtonContent.html(d)}},getContent:function(){if(c.dropDownButtonContent.children().length>0){return c.dropDownButtonContent.children()}return c.dropDownButtonContent.text()},_setSize:function(){if(c.width!=null&&c.width.toString().indexOf("px")!=-1){c.host[0].style.width=c.width}else{if(c.width!=undefined&&!isNaN(c.width)){c.host[0].style.width=parseInt(c.width)+"px"}}if(c.height!=null&&c.height.toString().indexOf("px")!=-1){c.host[0].style.height=c.height}else{if(c.height!=undefined&&!isNaN(c.height)){c.host[0].style.height=parseInt(c.height)+"px"}}var e=false;if(c.width!=null&&c.width.toString().indexOf("%")!=-1){e=true;c.host.width(c.width)}if(c.height!=null&&c.height.toString().indexOf("%")!=-1){e=true;c.host.height(c.height)}var d=this;if(e){c.refresh(false)}a.jqx.utilities.resize(c.host,function(){d._arrange()})},isOpened:function(){var e=this;var d=a.data(document.body,"openedJQXButton"+e.element.id);if(d!=null&&d==e.popupContent){return true}return false},focus:function(){try{c.host.focus()}catch(d){}},render:function(){c.removeHandlers();var d=this;var e=false;if(!c.touch){c.addHandler(c.host,"mouseenter",function(){if(!d.disabled&&d.enableHover){e=true;d.host.addClass(d.toThemeProperty("jqx-dropdownlist-state-hover"));d.arrow.addClass(d.toThemeProperty("jqx-icon-arrow-down-hover"));d.host.addClass(d.toThemeProperty("jqx-fill-state-hover"))}});c.addHandler(c.host,"mouseleave",function(){if(!d.disabled&&d.enableHover){d.host.removeClass(d.toThemeProperty("jqx-dropdownlist-state-hover"));d.host.removeClass(d.toThemeProperty("jqx-fill-state-hover"));d.arrow.removeClass(d.toThemeProperty("jqx-icon-arrow-down-hover"));e=false}})}if(d.autoOpen){c.addHandler(c.host,"mouseenter",function(){var f=d.isOpened();if(!f&&d.autoOpen){d.open();d.host.focus()}});c.addHandler(a(document),"mousemove."+d.element.id,function(i){var h=d.isOpened();if(h&&d.autoOpen){var m=d.host.coord();var l=m.top;var k=m.left;var j=d.container.coord();var f=j.left;var g=j.top;canClose=true;if(i.pageY>=l&&i.pageY<=l+d.host.height()){if(i.pageX>=k&&i.pageX<k+d.host.width()){canClose=false}}if(i.pageY>=g&&i.pageY<=g+d.container.height()){if(i.pageX>=f&&i.pageX<f+d.container.width()){canClose=false}}if(canClose){d.close()}}})}c.addHandler(c.dropDownButtonWrapper,"mousedown",function(g){if(!d.disabled){var f=d.container.css("visibility")=="visible";if(!d.isanimating){if(f){d.close();return false}else{d.open();if(!d.focusable){if(g.preventDefault){g.preventDefault()}}}}}});if(c.touch){c.addHandler(a(document),a.jqx.mobile.getTouchEventName("touchstart")+"."+c.element.id,d.closeOpenedDropDown,{me:this,popup:c.container,id:c.element.id})}c.addHandler(a(document),"mousedown."+c.element.id,d.closeOpenedDropDown,{me:this,popup:c.container,id:c.element.id});c.addHandler(c.host,"keydown",function(g){var f=d.container.css("visibility")=="visible";if(d.host.css("display")=="none"){return true}if(g.keyCode=="13"){if(!d.isanimating){if(f){d.close()}}}if(g.keyCode==115){if(!d.isanimating){if(!d.isOpened()){d.open()}else{if(d.isOpened()){d.close()}}}return false}if(g.altKey){if(d.host.css("display")=="block"){if(g.keyCode==38){if(d.isOpened()){d.close()}}else{if(g.keyCode==40){if(!d.isOpened()){d.open()}}}}}if(g.keyCode=="27"){if(!d.ishiding){d.close();if(d.tempSelectedIndex!=undefined){d.selectIndex(d.tempSelectedIndex)}}}});c.addHandler(c.firstDiv,"focus",function(){d.host.addClass(d.toThemeProperty("jqx-dropdownlist-state-focus"));d.host.addClass(d.toThemeProperty("jqx-fill-state-focus"))});c.addHandler(c.firstDiv,"blur",function(){d.host.removeClass(d.toThemeProperty("jqx-dropdownlist-state-focus"));d.host.removeClass(d.toThemeProperty("jqx-fill-state-focus"))})},removeHandlers:function(){var d=this;c.removeHandler(c.dropDownButtonWrapper,"mousedown");c.removeHandler(c.host,"keydown");c.removeHandler(c.firstDiv,"focus");c.removeHandler(c.firstDiv,"blur");c.removeHandler(c.host,"mouseenter");c.removeHandler(c.host,"mouseleave");if(c.autoOpen){c.removeHandler(c.host,"mouseenter");c.removeHandler(c.host,"mouseleave")}c.removeHandler(a(document),"mousemove."+d.element.id)},_findPos:function(e){while(e&&(e.type=="hidden"||e.nodeType!=1||a.expr.filters.hidden(e))){e=e.nextSibling}var d=a(e).coord(true);return[d.left,d.top]},testOffset:function(j,h,e){var i=j.outerWidth();var l=j.outerHeight();var k=a(window).width()+a(window).scrollLeft();var g=a(window).height()+a(window).scrollTop();if(h.left+i>k){if(i>c.host.width()){var f=c.host.coord().left;var d=i-c.host.width();h.left=f-d+2}}if(h.left<0){h.left=parseInt(c.host.coord().left)+"px"}if(h.top+l>g){h.top-=Math.abs(l+e)}return h},_getBodyOffset:function(){var e=0;var d=0;if(a("body").css("border-top-width")!="0px"){e=parseInt(a("body").css("border-top-width"));if(isNaN(e)){e=0}}if(a("body").css("border-left-width")!="0px"){d=parseInt(a("body").css("border-left-width"));if(isNaN(d)){d=0}}return{left:d,top:e}},open:function(){a.jqx.aria(this,"aria-expanded",true);var l=this;var r=this;if((l.dropDownWidth==null||l.dropDownWidth=="auto")&&l.width!=null&&l.width.indexOf&&l.width.indexOf("%")!=-1){var e=l.host.width();l.container.width(parseInt(e))}r._raiseEvent("2");var d=l.popupContent;var o=a(window).scrollTop();var j=a(window).scrollLeft();var n=parseInt(l._findPos(l.host[0])[1])+parseInt(l.host.outerHeight())-1+"px";var g,i=parseInt(Math.round(l.host.coord(true).left));g=i+"px";var q=a.jqx.mobile.isSafariMobileBrowser()||a.jqx.mobile.isWindowsPhone();l.ishiding=false;l.tempSelectedIndex=l.selectedIndex;if((q!=null&&q)){g=a.jqx.mobile.getLeftPos(l.element);n=a.jqx.mobile.getTopPos(l.element)+parseInt(l.host.outerHeight());if(a("body").css("border-top-width")!="0px"){n=parseInt(n)-l._getBodyOffset().top+"px"}if(a("body").css("border-left-width")!="0px"){g=parseInt(g)-l._getBodyOffset().left+"px"}}d.stop();l.host.addClass(l.toThemeProperty("jqx-dropdownlist-state-selected"));l.host.addClass(l.toThemeProperty("jqx-fill-state-pressed"));l.arrow.addClass(l.toThemeProperty("jqx-icon-arrow-down-selected"));var h=false;if(a.jqx.browser.msie&&a.jqx.browser.version<8){h=true}if(h){l.container.css("display","block")}l.container.css("left",g);l.container.css("top",n);var f=true;var s=false;var m=function(){if(l.dropDownHorizontalAlignment=="right"||l.rtl){var u=l.container.width();var t=Math.abs(u-l.host.width());if(u>l.host.width()){l.container.css("left",parseInt(Math.round(i))-t+"px")}else{l.container.css("left",parseInt(Math.round(i))+t+"px")}}};m.call(this);if(l.enableBrowserBoundsDetection){var k=l.testOffset(d,{left:parseInt(l.container.css("left")),top:parseInt(n)},parseInt(l.host.outerHeight()));if(parseInt(l.container.css("top"))!=k.top){s=true;l.container.height(d.outerHeight());d.css("top",23);if(l.interval){clearInterval(l.interval)}l.interval=setInterval(function(){if(d.outerHeight()!=r.container.height()){var t=r.testOffset(d,{left:parseInt(r.container.css("left")),top:parseInt(n)},parseInt(r.host.outerHeight()));r.container.css("top",t.top);r.container.height(d.outerHeight())}},50)}else{d.css("top",0)}l.container.css("top",k.top);if(parseInt(l.container.css("left"))!=k.left){l.container.css("left",k.left)}}if(l.animationType=="none"){l.container.css("visibility","visible");a.data(document.body,"openedJQXButtonParent",r);a.data(document.body,"openedJQXButton"+l.element.id,d);d.css("margin-top",0);d.css("opacity",1);l._raiseEvent("0");m.call(r)}else{l.container.css("visibility","visible");var p=d.outerHeight();r.isanimating=true;if(l.animationType=="fade"){d.css("margin-top",0);d.css("opacity",0);d.animate({opacity:1},l.openDelay,function(){a.data(document.body,"openedJQXButtonParent",r);a.data(document.body,"openedJQXButton"+r.element.id,d);r.ishiding=false;r.isanimating=false;r._raiseEvent("0")});m.call(r)}else{d.css("opacity",1);if(s){d.css("margin-top",p)}else{d.css("margin-top",-p)}m.call(r);d.animate({"margin-top":0},l.openDelay,function(){a.data(document.body,"openedJQXButtonParent",r);a.data(document.body,"openedJQXButton"+r.element.id,d);r.ishiding=false;r.isanimating=false;r._raiseEvent("0")})}}if(!s){l.host.addClass(l.toThemeProperty("jqx-rc-b-expanded"));l.container.addClass(l.toThemeProperty("jqx-rc-t-expanded"))}else{l.host.addClass(l.toThemeProperty("jqx-rc-t-expanded"));l.container.addClass(l.toThemeProperty("jqx-rc-b-expanded"))}if(l.focusable){l.firstDiv.focus();setTimeout(function(){r.firstDiv.focus()},10)}l.container.addClass(l.toThemeProperty("jqx-fill-state-focus"));l.host.addClass(r.toThemeProperty("jqx-dropdownlist-state-focus"));l.host.addClass(r.toThemeProperty("jqx-fill-state-focus"))},close:function(){a.jqx.aria(this,"aria-expanded",false);var i=this;var g=i.popupContent;var f=i.container;var h=this;h._raiseEvent("3");var e=false;if(a.jqx.browser.msie&&a.jqx.browser.version<8){e=true}if(!i.isOpened()){return}a.data(document.body,"openedJQXButton"+i.element.id,null);if(i.animationType=="none"){i.container.css("visibility","hidden");if(e){i.container.css("display","none")}}else{if(!h.ishiding){h.isanimating=true;g.stop();var d=g.outerHeight();g.css("margin-top",0);var j=-d;if(parseInt(i.container.coord().top)<parseInt(i.host.coord().top)){j=d}if(i.animationType=="fade"){g.css({opacity:1});g.animate({opacity:0},i.closeDelay,function(){f.css("visibility","hidden");h.isanimating=false;h.ishiding=false;if(e){f.css("display","none")}})}else{g.animate({"margin-top":j},i.closeDelay,function(){f.css("visibility","hidden");h.isanimating=false;h.ishiding=false;if(e){f.css("display","none")}})}}}i.ishiding=true;i.host.removeClass(i.toThemeProperty("jqx-dropdownlist-state-selected"));i.host.removeClass(i.toThemeProperty("jqx-fill-state-pressed"));i.arrow.removeClass(i.toThemeProperty("jqx-icon-arrow-down-selected"));i.host.removeClass(i.toThemeProperty("jqx-rc-b-expanded"));i.container.removeClass(i.toThemeProperty("jqx-rc-t-expanded"));i.host.removeClass(i.toThemeProperty("jqx-rc-t-expanded"));i.container.removeClass(i.toThemeProperty("jqx-rc-b-expanded"));i.container.removeClass(i.toThemeProperty("jqx-fill-state-focus"));i.host.removeClass(i.toThemeProperty("jqx-dropdownlist-state-focus"));i.host.removeClass(i.toThemeProperty("jqx-fill-state-focus"));i._raiseEvent("1")},closeOpenedDropDown:function(g){var e=g.data.me;var d=a(g.target);if(a(g.target).ischildof(g.data.me.host)){return true}if(a(g.target).ischildof(g.data.me.popupContent)){return true}var h=e;var f=false;a.each(d.parents(),function(){if(this.className!="undefined"){if(this.className.indexOf&&this.className.indexOf("dropDownButton")!=-1){f=true;return false}}});if(!f){e.close()}return true},refresh:function(){c._arrange()},_arrange:function(){var i=this;var h=parseInt(i.host.width());var d=parseInt(i.host.height());var g=i.arrowSize;var f=i.arrowSize;var j=3;var e=h-f-2*j;if(e>0){i.dropDownButtonContent[0].style.width=e+"px"}i.dropDownButtonContent[0].style.height=parseInt(d)+"px";i.dropDownButtonContent[0].style.left="0px";i.dropDownButtonContent[0].style.top="0px";i.dropDownButtonArrow[0].style.width=parseInt(f)+"px";i.dropDownButtonArrow[0].style.height=parseInt(d)+"px";if(i.rtl){i.dropDownButtonArrow.css("float","left");i.dropDownButtonContent.css("float","right");i.dropDownButtonContent.css("left",-j)}if(i.dropDownWidth!=null){if(i.dropDownWidth.toString().indexOf("%")>=0){var h=(parseInt(i.dropDownWidth)*i.host.width())/100;i.container.width(h)}else{i.container.width(i.dropDownWidth)}}if(i.dropDownHeight!=null){i.container.height(i.dropDownHeight)}},destroy:function(){var d=this;d.removeHandler(d.dropDownButtonWrapper,"selectstart");d.removeHandler(d.dropDownButtonWrapper,"mousedown");d.removeHandler(d.host,"keydown");d.host.removeClass();d.removeHandler(a(document),"mousedown."+d.element.id,self.closeOpenedDropDown);d.host.remove();d.container.remove()},_raiseEvent:function(h,e){if(e==undefined){e={owner:null}}if(h==2&&!c.contentInitialized){if(c.initContent){c.initContent();c.contentInitialized=true}}var f=c.events[h];args=e;args.owner=this;var g=new a.Event(f);g.owner=this;if(h==2||h==3||h==4){g.args=e}var d=c.host.trigger(g);return d},resize:function(e,d){c.width=e;c.height=d;c._setSize();c._arrange()},propertyChangedHandler:function(d,e,g,f){if(c.isInitialized==undefined||c.isInitialized==false){return}if(e=="rtl"){if(f){d.dropDownButtonArrow.css("float","left");d.dropDownButtonContent.css("float","right")}else{d.dropDownButtonArrow.css("float","right");d.dropDownButtonContent.css("float","left")}}if(e=="autoOpen"){d.render()}if(e=="theme"&&f!=null){a.jqx.utilities.setTheme(g,f,d.host)}if(e=="width"||e=="height"){d._setSize();d._arrange()}}};a.extend(true,this,b)}})})(jqxBaseFramework);
\ No newline at end of file
+*/
+!function(a){a.jqx.jqxWidget("jqxDropDownButton","",{}),a.extend(a.jqx._jqxDropDownButton.prototype,{defineInstance:function(){var b={disabled:!1,width:null,height:null,arrowSize:19,enableHover:!0,openDelay:250,closeDelay:300,animationType:"default",enableBrowserBoundsDetection:!1,dropDownHorizontalAlignment:"left",dropDownVerticalAlignment:"bottom",popupZIndex:2e4,dropDownContainer:"default",autoOpen:!1,rtl:!1,initContent:null,dropDownWidth:null,dropDownHeight:null,focusable:!0,template:"default",touchMode:!1,aria:{"aria-disabled":{name:"disabled",type:"boolean"}},events:["open","close","opening","closing"]};return this===a.jqx._jqxDropDownButton.prototype?b:(a.extend(!0,this,b),b)},createInstance:function(b){var c=this;c.width||(c.width=200),c.height||(c.height=25),c.isanimating=!1,c.setupInstance();var d=a("<div style='background-color: transparent; -webkit-appearance: none; outline: none; width:100%; height: 100%; padding: 0px; margin: 0px; border: 0px; position: relative;'><div id='dropDownButtonWrapper' style='outline: none; background-color: transparent; border: none; float: left; width:100%; height: 100%; position: relative;'><div id='dropDownButtonContent' unselectable='on' style='outline: none; background-color: transparent; border: none; float: left; position: relative;'/><div id='dropDownButtonArrow' unselectable='on'  style='background-color: transparent; border: none; float: right; position: relative;'><div unselectable='on'></div></div></div></div>");c.host.attr("tabindex")?(d.attr("tabindex",c.host.attr("tabindex")),c.host.removeAttr("tabindex")):d.attr("tabindex",0),c.focusable||d.removeAttr("tabIndex"),a.jqx.aria(this),c.popupContent=c.host.children(),c.host.attr("role","button"),0==c.popupContent.length?(c.popupContent=a("<div>"+c.host.text()+"</div>"),c.popupContent.css("display","block"),c.element.innerHTML=""):c.popupContent.detach();var e=this;c.addHandler(c.host,"loadContent",function(a){e._arrange()});try{var f="dropDownButtonPopup"+c.element.id,g=a(a.find("#"+f));g.length>0&&g.remove(),a.jqx.aria(this,"aria-haspopup",!0),a.jqx.aria(this,"aria-owns",f);var h=a("<div class='dropDownButton' style='overflow: hidden; left: -1000px; top: -1000px; position: absolute;' id='dropDownButtonPopup"+c.element.id+"'></div>");h.addClass(c.toThemeProperty("jqx-widget-content")),h.addClass(c.toThemeProperty("jqx-dropdownbutton-popup")),h.addClass(c.toThemeProperty("jqx-popup")),h.addClass(c.toThemeProperty("jqx-rc-all")),"element"!=c.dropDownContainer&&h.css("z-index",c.popupZIndex),a.jqx.browser.msie&&h.addClass(c.toThemeProperty("jqx-noshadow")),c.popupContent.appendTo(h),"element"==c.dropDownContainer?h.appendTo(c.host):h.appendTo(document.body),c.container=h,c.container.css("visibility","hidden")}catch(a){}c.touch=a.jqx.mobile.isTouchDevice(),c.dropDownButtonStructure=d,c.host.append(d),c.dropDownButtonWrapper=c.host.find("#dropDownButtonWrapper"),c.firstDiv=c.dropDownButtonWrapper.parent(),c.dropDownButtonArrow=c.host.find("#dropDownButtonArrow"),c.arrow=a(c.dropDownButtonArrow.children()[0]),c.dropDownButtonContent=c.host.find("#dropDownButtonContent"),c.dropDownButtonContent.addClass(c.toThemeProperty("jqx-dropdownlist-content")),c.dropDownButtonWrapper.addClass(c.toThemeProperty("jqx-disableselect")),c.rtl&&c.dropDownButtonContent.addClass(c.toThemeProperty("jqx-rtl"));var i=this;c.host.parents()&&c.addHandler(c.host.parents(),"scroll.dropdownbutton"+c.element.id,function(a){var b=i.isOpened();b&&i.close()}),c.addHandler(c.dropDownButtonWrapper,"selectstart",function(){return!1}),c.dropDownButtonWrapper[0].id="dropDownButtonWrapper"+c.element.id,c.dropDownButtonArrow[0].id="dropDownButtonArrow"+c.element.id,c.dropDownButtonContent[0].id="dropDownButtonContent"+c.element.id;var i=this;c.propertyChangeMap.disabled=function(b,c,d,e){e?(b.host.addClass(i.toThemeProperty("jqx-dropdownlist-state-disabled")),b.host.addClass(i.toThemeProperty("jqx-fill-state-disabled")),b.dropDownButtonContent.addClass(i.toThemeProperty("jqx-dropdownlist-content-disabled"))):(b.host.removeClass(i.toThemeProperty("jqx-dropdownlist-state-disabled")),b.host.removeClass(i.toThemeProperty("jqx-fill-state-disabled")),b.dropDownButtonContent.removeClass(i.toThemeProperty("jqx-dropdownlist-content-disabled"))),a.jqx.aria(b,"aria-disabled",b.disabled)},c.disabled&&(c.host.addClass(c.toThemeProperty("jqx-dropdownlist-state-disabled")),c.host.addClass(c.toThemeProperty("jqx-fill-state-disabled")),c.dropDownButtonContent.addClass(c.toThemeProperty("jqx-dropdownlist-content-disabled")));var j=c.toThemeProperty("jqx-rc-all")+" "+c.toThemeProperty("jqx-fill-state-normal")+" "+c.toThemeProperty("jqx-widget")+" "+c.toThemeProperty("jqx-widget-content")+" "+c.toThemeProperty("jqx-dropdownlist-state-normal");if(c.host.addClass(j),c.arrow.addClass(c.toThemeProperty("jqx-icon-arrow-down")),c.arrow.addClass(c.toThemeProperty("jqx-icon")),c.template&&c.host.addClass(c.toThemeProperty("jqx-"+c.template)),c._setSize(),c.render(),a.jqx.browser.msie&&a.jqx.browser.version<8&&(c.container.css("display","none"),c.host.parents(".jqx-window").length>0)){var k=c.host.parents(".jqx-window").css("z-index");h.css("z-index",k+10),c.container.css("z-index",k+10)}},setupInstance:function(){var b=this,c={setContent:function(a){b.dropDownButtonContent.children().remove(),b.dropDownButtonContent[0].innerHTML="",b.dropDownButtonContent.append(a)},val:function(a){return 0==arguments.length||"object"==typeof a?b.dropDownButtonContent.text():void b.dropDownButtonContent.html(a)},getContent:function(){return b.dropDownButtonContent.children().length>0?b.dropDownButtonContent.children():b.dropDownButtonContent.text()},_setSize:function(){null!=b.width&&b.width.toString().indexOf("px")!=-1?b.host[0].style.width=b.width:void 0==b.width||isNaN(b.width)||(b.host[0].style.width=parseInt(b.width)+"px"),null!=b.height&&b.height.toString().indexOf("px")!=-1?b.host[0].style.height=b.height:void 0==b.height||isNaN(b.height)||(b.host[0].style.height=parseInt(b.height)+"px");var c=!1;null!=b.width&&b.width.toString().indexOf("%")!=-1&&(c=!0,b.host.width(b.width)),null!=b.height&&b.height.toString().indexOf("%")!=-1&&(c=!0,b.host.height(b.height));var d=this;c&&b.refresh(!1),a.jqx.utilities.resize(b.host,function(){d._arrange()})},isOpened:function(){var b=this,c=a.data(document.body,"openedJQXButton"+b.element.id);return null!=c&&c==b.popupContent},focus:function(){try{b.host.focus()}catch(a){}},render:function(){b.removeHandlers();var c=this,d=!1;b.touch||(b.addHandler(b.host,"mouseenter",function(){!c.disabled&&c.enableHover&&(d=!0,c.host.addClass(c.toThemeProperty("jqx-dropdownlist-state-hover")),c.arrow.addClass(c.toThemeProperty("jqx-icon-arrow-down-hover")),c.host.addClass(c.toThemeProperty("jqx-fill-state-hover")))}),b.addHandler(b.host,"mouseleave",function(){!c.disabled&&c.enableHover&&(c.host.removeClass(c.toThemeProperty("jqx-dropdownlist-state-hover")),c.host.removeClass(c.toThemeProperty("jqx-fill-state-hover")),c.arrow.removeClass(c.toThemeProperty("jqx-icon-arrow-down-hover")),d=!1)})),c.autoOpen&&(b.addHandler(b.host,"mouseenter",function(){var a=c.isOpened();!a&&c.autoOpen&&(c.open(),c.host.focus())}),b.addHandler(a(document),"mousemove."+c.element.id,function(a){var b=c.isOpened();if(b&&c.autoOpen){var d=c.host.coord(),e=d.top,f=d.left,g=c.container.coord(),h=g.left,i=g.top;canClose=!0,a.pageY>=e&&a.pageY<=e+c.host.height()&&a.pageX>=f&&a.pageX<f+c.host.width()&&(canClose=!1),a.pageY>=i&&a.pageY<=i+c.container.height()&&a.pageX>=h&&a.pageX<h+c.container.width()&&(canClose=!1),canClose&&c.close()}})),b.addHandler(b.dropDownButtonWrapper,"mousedown",function(a){if(!c.disabled){var b="visible"==c.container.css("visibility");if(!c.isanimating){if(b)return c.close(),!1;c.open(),c.focusable||a.preventDefault&&a.preventDefault()}}}),b.touch&&b.addHandler(a(document),a.jqx.mobile.getTouchEventName("touchstart")+"."+b.element.id,c.closeOpenedDropDown,{me:this,popup:b.container,id:b.element.id}),b.addHandler(a(document),"mousedown."+b.element.id,c.closeOpenedDropDown,{me:this,popup:b.container,id:b.element.id}),b.addHandler(b.host,"keydown",function(a){var b="visible"==c.container.css("visibility");return"none"==c.host.css("display")||("13"==a.keyCode&&(c.isanimating||b&&c.close()),115==a.keyCode?(c.isanimating||(c.isOpened()?c.isOpened()&&c.close():c.open()),!1):(a.altKey&&"block"==c.host.css("display")&&(38==a.keyCode?c.isOpened()&&c.close():40==a.keyCode&&(c.isOpened()||c.open())),void("27"==a.keyCode&&(c.ishiding||(c.close(),void 0!=c.tempSelectedIndex&&c.selectIndex(c.tempSelectedIndex))))))}),b.addHandler(b.firstDiv,"focus",function(){c.host.addClass(c.toThemeProperty("jqx-dropdownlist-state-focus")),c.host.addClass(c.toThemeProperty("jqx-fill-state-focus"))}),b.addHandler(b.firstDiv,"blur",function(){c.host.removeClass(c.toThemeProperty("jqx-dropdownlist-state-focus")),c.host.removeClass(c.toThemeProperty("jqx-fill-state-focus"))})},removeHandlers:function(){var c=this;b.removeHandler(b.dropDownButtonWrapper,"mousedown"),b.removeHandler(b.host,"keydown"),b.removeHandler(b.firstDiv,"focus"),b.removeHandler(b.firstDiv,"blur"),b.removeHandler(b.host,"mouseenter"),b.removeHandler(b.host,"mouseleave"),b.autoOpen&&(b.removeHandler(b.host,"mouseenter"),b.removeHandler(b.host,"mouseleave")),b.removeHandler(a(document),"mousemove."+c.element.id)},_findPos:function(b){for(;b&&("hidden"==b.type||1!=b.nodeType||a.expr.filters.hidden(b));)b=b.nextSibling;var c=a(b).coord(!0);return[c.left,c.top]},testOffset:function(c,d,e){var f=c.outerWidth(),g=c.outerHeight(),h=a(window).width()+a(window).scrollLeft(),i=a(window).height()+a(window).scrollTop();if(d.left+f>h&&f>b.host.width()){var j=b.host.coord().left,k=f-b.host.width();d.left=j-k+2}return d.left<0&&(d.left=parseInt(b.host.coord().left)+"px"),d.top-=Math.min(d.top,d.top+g>i&&i>g?Math.abs(g+e+22):0),d},_getBodyOffset:function(){var b=0,c=0;return"0px"!=a("body").css("border-top-width")&&(b=parseInt(a("body").css("border-top-width")),isNaN(b)&&(b=0)),"0px"!=a("body").css("border-left-width")&&(c=parseInt(a("body").css("border-left-width")),isNaN(c)&&(c=0)),{left:c,top:b}},open:function(){a.jqx.aria(this,"aria-expanded",!0);var b=this,c=this;if((null==b.dropDownWidth||"auto"==b.dropDownWidth)&&null!=b.width&&b.width.indexOf&&b.width.indexOf("%")!=-1){var d=b.host.width();b.container.width(parseInt(d))}c._raiseEvent("2");var e,f=b.popupContent,g=(a(window).scrollTop(),a(window).scrollLeft(),parseInt(b._findPos(b.host[0])[1])+parseInt(b.host.outerHeight())-1+"px"),h=parseInt(Math.round(b.host.coord(!0).left));e=h+"px";var i=a.jqx.mobile.isSafariMobileBrowser()||a.jqx.mobile.isWindowsPhone();b.ishiding=!1,b.tempSelectedIndex=b.selectedIndex,null!=i&&i&&(e=a.jqx.mobile.getLeftPos(b.element),g=a.jqx.mobile.getTopPos(b.element)+parseInt(b.host.outerHeight()),"0px"!=a("body").css("border-top-width")&&(g=parseInt(g)-b._getBodyOffset().top+"px"),"0px"!=a("body").css("border-left-width")&&(e=parseInt(e)-b._getBodyOffset().left+"px")),f.stop(),b.host.addClass(b.toThemeProperty("jqx-dropdownlist-state-selected")),b.host.addClass(b.toThemeProperty("jqx-fill-state-pressed")),b.arrow.addClass(b.toThemeProperty("jqx-icon-arrow-down-selected"));var j=!1;a.jqx.browser.msie&&a.jqx.browser.version<8&&(j=!0),j&&b.container.css("display","block"),b.container.css("left",e),b.container.css("top",g);var k=!1,l=function(){if("right"==b.dropDownHorizontalAlignment||b.rtl){var a=b.container.width(),c=Math.abs(a-b.host.width());a>b.host.width()?b.container.css("left",parseInt(Math.round(h))-c+"px"):b.container.css("left",parseInt(Math.round(h))+c+"px")}};if(l.call(this),"top"==b.dropDownVerticalAlignment){var m=f.height();k=!0,b.container.height(f.outerHeight()),f.addClass(this.toThemeProperty("jqx-popup-up"));var n=parseInt(b.host.outerHeight()),o=parseInt(g)-Math.abs(m+n);b.interval&&clearInterval(b.interval),b.interval=setInterval(function(){if(f.outerHeight()!=b.container.height()){b.container.height(f.outerHeight());var a=parseInt(g)-Math.abs(f.height()+n);b.container.css("top",a)}},50),f.css("top",23),b.container.css("top",o)}if(b.enableBrowserBoundsDetection){var p=b.testOffset(f,{left:parseInt(b.container.css("left")),top:parseInt(g)},parseInt(b.host.outerHeight()));parseInt(b.container.css("top"))!=p.top?(k=!0,b.container.height(f.outerHeight()),f.css("top",23),b.interval&&clearInterval(b.interval),b.interval=setInterval(function(){if(f.outerHeight()!=c.container.height()){var a=c.testOffset(f,{left:parseInt(b.container.css("left")),top:parseInt(g)},parseInt(b.host.outerHeight()));b.container.css("top",a.top),b.container.height(f.outerHeight())}},50)):f.css("top",0),b.container.css("top",p.top),parseInt(b.container.css("left"))!=p.left&&b.container.css("left",p.left)}if("none"==b.animationType)b.container.css("visibility","visible"),a.data(document.body,"openedJQXButtonParent",c),a.data(document.body,"openedJQXButton"+b.element.id,f),f.css("margin-top",0),f.css("opacity",1),b._raiseEvent("0"),l.call(c);else{b.container.css("visibility","visible");var q=f.outerHeight();c.isanimating=!0,"fade"==b.animationType?(f.css("margin-top",0),f.css("opacity",0),f.animate({opacity:1},b.openDelay,function(){a.data(document.body,"openedJQXButtonParent",c),a.data(document.body,"openedJQXButton"+c.element.id,f),c.ishiding=!1,c.isanimating=!1,c._raiseEvent("0")}),l.call(c)):(f.css("opacity",1),k?f.css("margin-top",q):f.css("margin-top",-q),l.call(c),k?f.animate({"margin-top":0},b.openDelay,function(){a.data(document.body,"openedJQXButtonParent",c),a.data(document.body,"openedJQXButton"+c.element.id,f),c.ishiding=!1,c.isanimating=!1,c._raiseEvent("0")}):f.animate({"margin-top":0},b.openDelay,function(){a.data(document.body,"openedJQXButtonParent",c),a.data(document.body,"openedJQXButton"+c.element.id,f),c.ishiding=!1,c.isanimating=!1,c._raiseEvent("0")}))}k?(b.host.addClass(b.toThemeProperty("jqx-rc-t-expanded")),b.container.addClass(b.toThemeProperty("jqx-rc-b-expanded"))):(b.host.addClass(b.toThemeProperty("jqx-rc-b-expanded")),b.container.addClass(b.toThemeProperty("jqx-rc-t-expanded"))),b.focusable&&(b.firstDiv.focus(),setTimeout(function(){c.firstDiv.focus()},10)),b.container.addClass(b.toThemeProperty("jqx-fill-state-focus")),b.host.addClass(c.toThemeProperty("jqx-dropdownlist-state-focus")),b.host.addClass(c.toThemeProperty("jqx-fill-state-focus"))},close:function(){a.jqx.aria(this,"aria-expanded",!1);var b=this,c=b.popupContent,d=b.container,e=this;e._raiseEvent("3");var f=!1;if(a.jqx.browser.msie&&a.jqx.browser.version<8&&(f=!0),b.isOpened()){if(a.data(document.body,"openedJQXButton"+b.element.id,null),"none"==b.animationType)b.container.css("visibility","hidden"),f&&b.container.css("display","none");else if(!e.ishiding){e.isanimating=!0,c.stop();var g=c.outerHeight();c.css("margin-top",0);var h=-g;parseInt(b.container.coord().top)<parseInt(b.host.coord().top)&&(h=g),"fade"==b.animationType?(c.css({opacity:1}),c.animate({opacity:0},b.closeDelay,function(){d.css("visibility","hidden"),e.isanimating=!1,e.ishiding=!1,f&&d.css("display","none")})):c.animate({"margin-top":h},b.closeDelay,function(){d.css("visibility","hidden"),e.isanimating=!1,e.ishiding=!1,f&&d.css("display","none")})}b.ishiding=!0,b.host.removeClass(b.toThemeProperty("jqx-dropdownlist-state-selected")),b.host.removeClass(b.toThemeProperty("jqx-fill-state-pressed")),b.arrow.removeClass(b.toThemeProperty("jqx-icon-arrow-down-selected")),b.host.removeClass(b.toThemeProperty("jqx-rc-b-expanded")),b.container.removeClass(b.toThemeProperty("jqx-rc-t-expanded")),b.host.removeClass(b.toThemeProperty("jqx-rc-t-expanded")),b.container.removeClass(b.toThemeProperty("jqx-rc-b-expanded")),b.container.removeClass(b.toThemeProperty("jqx-fill-state-focus")),b.host.removeClass(b.toThemeProperty("jqx-dropdownlist-state-focus")),b.host.removeClass(b.toThemeProperty("jqx-fill-state-focus")),b._raiseEvent("1")}},closeOpenedDropDown:function(b){var c=b.data.me,d=a(b.target);if(a(b.target).ischildof(b.data.me.host))return!0;if(a(b.target).ischildof(b.data.me.popupContent))return!0;var e=!1;return a.each(d.parents(),function(){if("undefined"!=this.className){if(this.className.indexOf&&this.className.indexOf("dropDownButton")!=-1)return e=!0,!1;if(this.className.indexOf&&this.className.indexOf("jqx-popup")!=-1)return e=!0,!1}}),e||c.close(),!0},refresh:function(){b._arrange()},_arrange:function(){var a=this,b=parseInt(a.host.width()),c=parseInt(a.host.height()),d=(a.arrowSize,a.arrowSize),e=3,f=b-d-2*e;if(f>0&&(a.dropDownButtonContent[0].style.width=f+"px"),a.dropDownButtonContent[0].style.height=parseInt(c)+"px",a.dropDownButtonContent[0].style.left="0px",a.dropDownButtonContent[0].style.top="0px",a.dropDownButtonArrow[0].style.width=parseInt(d)+"px",a.dropDownButtonArrow[0].style.height=parseInt(c)+"px",a.rtl&&(a.dropDownButtonArrow.css("float","left"),a.dropDownButtonContent.css("float","right"),a.dropDownButtonContent.css("left",-e)),null!=a.dropDownWidth)if(a.dropDownWidth.toString().indexOf("%")>=0){var b=parseInt(a.dropDownWidth)*a.host.width()/100;a.container.width(b)}else a.container.width(a.dropDownWidth);null!=a.dropDownHeight&&a.container.height(a.dropDownHeight)},destroy:function(){a.jqx.utilities.resize(this.host,null,!0);var b=this;b.interval&&clearInterval(b.interval),b.removeHandler(b.dropDownButtonWrapper,"selectstart"),b.removeHandler(b.dropDownButtonWrapper,"mousedown"),b.removeHandler(b.host,"keydown"),b.host.removeClass(),b.removeHandler(a(document),"mousedown."+b.element.id,self.closeOpenedDropDown),b.host.remove(),b.container.remove()},_raiseEvent:function(c,d){void 0==d&&(d={owner:null}),2!=c||b.contentInitialized||b.initContent&&(b.initContent(),b.contentInitialized=!0);var e=b.events[c];args=d,args.owner=this;var f=new a.Event(e);f.owner=this,2!=c&&3!=c&&4!=c||(f.args=d);var g=b.host.trigger(f);return g},resize:function(a,c){b.width=a,b.height=c,b._setSize(),b._arrange()},propertiesChangedHandler:function(a,b,c){c.width&&c.height&&2==Object.keys(c).length&&(a._setSize(),a._arrange(),a.close())},propertyChangedHandler:function(c,d,e,f){void 0!=b.isInitialized&&0!=b.isInitialized&&(c.batchUpdate&&c.batchUpdate.width&&c.batchUpdate.height&&2==Object.keys(c.batchUpdate).length||("template"==d&&(c.host.removeClass(c.toThemeProperty("jqx-"+e)),c.host.addClass(c.toThemeProperty("jqx-"+c.template))),"rtl"==d&&(f?(c.dropDownButtonArrow.css("float","left"),c.dropDownButtonContent.css("float","right")):(c.dropDownButtonArrow.css("float","right"),c.dropDownButtonContent.css("float","left"))),"autoOpen"==d&&c.render(),"theme"==d&&null!=f&&a.jqx.utilities.setTheme(e,f,c.host),"width"!=d&&"height"!=d||(c._setSize(),c._arrange())))}};a.extend(!0,this,c)}})}(jqxBaseFramework);
+

mercurial