diff -r 033898178630 -r 37f1a08315f3 www/jqwidgets/jqxtabs.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/jqwidgets/jqxtabs.js Sun Aug 05 11:32:13 2018 +0200 @@ -0,0 +1,9 @@ +/* +jQWidgets v6.0.5 (2018-July) +Copyright (c) 2011-2018 jQWidgets. +License: https://jqwidgets.com/license/ +*/ +/* eslint-disable */ + +(function(a){a.jqx.jqxWidget("jqxTabs","",{});a.extend(a.jqx._jqxTabs.prototype,{defineInstance:function(){var b={scrollAnimationDuration:200,enabledHover:true,disabled:false,collapsible:false,animationType:"none",enableScrollAnimation:true,contentTransitionDuration:450,toggleMode:"click",selectedItem:0,height:"auto",width:"auto",position:"top",selectionTracker:false,scrollable:true,scrollPosition:"right",scrollStep:70,autoHeight:true,headerHeight:null,showCloseButtons:false,canCloseAllTabs:true,closeButtonSize:16,arrowButtonSize:16,keyboardNavigation:true,reorder:false,selectionTrackerAnimationDuration:300,_isTouchDevice:false,roundedCorners:true,_headerExpandingBalance:0,_dragStarted:false,_tabCaptured:false,_lastUnorderedListPosition:0,_selectedItem:0,_titleList:[],_contentList:[],_contentWrapper:null,_unorderedList:null,_scrollTimeout:null,isCollapsed:false,touchMode:false,initTabContent:null,enableDropAnimation:false,_currentEvent:null,_needScroll:true,_isAnimated:{},_events:["created","selected","add","removed","enabled","disabled","selecting","unselecting","unselected","dragStart","dragEnd","locked","unlocked","collapsed","expanded","tabclick"],_initTabContentList:[],_invalidArgumentExceptions:{invalidScrollAnimationDuration:"The scroll animation duration is not valid!",invalidWidth:"Width you've entered is invalid!",invalidHeight:"Height you've entered is invalid!",invalidAnimationType:"You've entered invalid animation type!",invalidcontentTransitionDuration:"You've entered invalid value for contentTransitionDuration!",invalidToggleMode:"You've entered invalid value for toggleMode!",invalidPosition:"You've entered invalid position!",invalidScrollPosition:"You've entered invalid scroll position!",invalidScrollStep:"You've entered invalid scroll step!",invalidStructure:"Invalid structure!",invalidArrowSize:"Invalid scroll button size!",invalidCloseSize:"Invalid close button size!"},aria:{"aria-disabled":{name:"disabled",type:"boolean"}},rtl:false};if(this===a.jqx._jqxTabs.prototype){return b}a.extend(true,this,b);return b},createInstance:function(){this._IE8=a.jqx.browser.msie&&a.jqx.browser.version<9;a.jqx.aria(this);this.element.className+=" "+this.toThemeProperty("jqx-tabs jqx-widget jqx-widget-content");this.element.setAttribute("role","tablist");var e=this.host.children();for(var b=0;b0&&f._contentList[f.selectedItem]){a(f._contentList[f.selectedItem]).trigger(j)}},50+f.selectionTrackerAnimationDuration)}else{var d=new a.Event("loadContent");if(!f._initTabContentList[f.selectedItem]){if(f.initTabContent){f.initTabContent(f.selectedItem);f._initTabContentList[f.selectedItem]=true}}d.owner=this;var h=new a.Event("resize");this.host.trigger(h)}}}catch(c){if(c&&console){console.log(c)}}return b},_getArrowsDisplacement:function(){if(!this._needScroll){return 0}var d;var c=this.arrowButtonSize;var b=this.arrowButtonSize;if(this.scrollPosition==="left"){d=c+b}else{if(this.scrollPosition==="both"){d=c}else{d=0}}return d},_scrollRight:function(e){this._stop(this._unorderedListHelper);this._unlockAnimation("unorderedList");var f=parseInt(this._width(this._unorderedList)+parseInt(this._unorderedListHelper.css("margin-left"),10),10),h=this._width(this.element),g,i,b=parseInt(this._unorderedListHelper.css("left"),10),c=this._getArrowsDisplacement(),d=0,j;if(this.scrollable){g=this._leftArrow.offsetWidth;i=this._rightArrow.offsetWidth}else{g=0;i=0}e=(this.enableScrollAnimation)?e:0;if(this._width(this._headerWrapper)>parseInt(this._unorderedListHelper.css("margin-left"),10)+this._width(this._unorderedList)){d=c}else{if(Math.abs(b)+this.scrollStepparseInt(this._unorderedListHelper.css("left"),10)+4){j=h-f-g-i+parseInt(a(this._titleList[this._selectedItem]).position().left,10)}}}this._performScrollAnimation(d,j,e)},_scrollLeft:function(f){this._stop(this._unorderedListHelper);this._unlockAnimation("unorderedList");var b=parseInt(this._unorderedListHelper.css("left"),10),c=this._getArrowsDisplacement(),e=0,d;f=(this.enableScrollAnimation)?f:0;if(this._width(this._headerWrapper)>=this._width(this._unorderedList)){e=c}else{if(b+this.scrollStepparseInt(this._unorderedListHelper.css("left"),10)+4){d=parseInt(a(this._titleList[this._selectedItem]).position().left,10)}}}this._performScrollAnimation(e,d,f)},_performScrollAnimation:function(e,d,c){var b=this;if(d!==undefined){this._moveSelectionTrack(this._selectedItem,0,d)}this._lockAnimation("unorderedList");b._refreshBarPosition();this._unorderedListHelper.animate({left:e},c,function(){b._moveSelectionTrack(b.selectedItem,0);b._unlockAnimation("unorderedList");b._refreshBarPosition()})},_addKeyboardHandlers:function(){var b=this;if(this.keyboardNavigation){this.addHandler(this.host,"keydown",function(e){if(!b._activeAnimation()){var f=b._selectedItem;var d=b.selectionTracker;var c=b.getContentAt(f);if(a(e.target).ischildof(c)){return true}if(a(document.activeElement).ischildof(a(c))){return true}switch(e.keyCode){case 37:if(b.rtl){b.next()}else{b.previous()}return false;case 39:if(b.rtl){b.previous()}else{b.next()}return false;case 36:b.first();return false;case 35:b.last();return false;case 27:if(b._tabCaptured){b._cancelClick=true;b._uncapture(null,b.selectedItem);b._tabCaptured=false}break}b.selectionTracker=d}return true})}},_addScrollHandlers:function(){var b=this;this.addHandler(this._leftArrow,"mousedown",function(){b._startScrollRepeat(true,b.scrollAnimationDuration)});this.addHandler(this._rightArrow,"mousedown",function(){b._startScrollRepeat(false,b.scrollAnimationDuration)});this.addHandler(this._rightArrow,"mouseleave",function(){clearTimeout(b._scrollTimeout)});this.addHandler(this._leftArrow,"mouseleave",function(){clearTimeout(b._scrollTimeout)});this.addHandler(a(document),"mouseup.tab"+this.element.id,this._mouseUpScrollDocumentHandler,this);this.addHandler(a(document),"mouseleave.tab"+this.element.id,this._mouseLeaveScrollDocumentHandler,this)},_mouseLeaveScrollDocumentHandler:function(c){var b=c.data;if(!b._scrollTimeout){return}clearTimeout(b._scrollTimeout)},_mouseUpScrollDocumentHandler:function(c){var b=c.data;clearTimeout(b._scrollTimeout)},_mouseUpDragDocumentHandler:function(c){var b=c.data;if(b._tabCaptured&&b._dragStarted){b._uncapture(c)}b._tabCaptured=false},_addReorderHandlers:function(){var b=this;b.addHandler(a(document),"mousemove.tab"+b.element.id,b._moveElement,b);b.addHandler(a(document),"mouseup.tab"+b.element.id,b._mouseUpDragDocumentHandler,b)},_addEventHandlers:function(){var e=this.length();while(e){e--;this._addEventListenerAt(e)}if(this.keyboardNavigation){this._addKeyboardHandlers()}if(this.scrollable){this._addScrollHandlers()}if(this.reorder&&!this._isTouchDevice){this._addReorderHandlers()}var d=this;try{if(document.referrer!==""||window.frameElement){if(window.top!==null&&window.top!==window.self){var c=function(){if(d._tabCaptured){d._cancelClick=true;d._uncapture(null,d.selectedItem);d._tabCaptured=false}};var f=null;if(window.parent&&document.referrer){f=document.referrer}if(f&&f.indexOf(document.location.host)!==-1){if(window.top.document){this.addHandler(a(window.top.document),"mouseup.tabs"+this.element.id,c)}}}}}catch(b){}},focus:function(){try{this.host.focus();var c=this;setTimeout(function(){c.host.focus()},25)}catch(b){}},_getFocusedItem:function(c){var d=this.length();while(d){d--;var b=this._titleList[d],g=this._outerWidth(b,true),f=parseInt(a(b).offset().left,10),e=f;if((e<=c&&e+g>=c)&&(b!==this._capturedElement)&&(!this._titleList[d].locked)&&(this._titleList[d].disabled!==true)){return d}}return -1},_uncapture:function(f){var e=this.selectionTracker;this._unorderedListLeftBackup=this._unorderedListHelper.css("left");this._dragStarted=false;this._tabCaptured=false;var b=this._indexOf(this._capturedElement);if(!this._capturedElement){return}switch(this.position){case"top":this._capturedElement.style.bottom="0px";break;case"bottom":this._capturedElement.style.top="0px";break}var d;if(f){d=this._getFocusedItem(f.clientX)}if(d===-1||!f){this._capturedElement.style.left="0px"}else{this._raiseEvent(10,{item:b,dropIndex:d});this._reorderItems(d,b)}for(var c=0;c=e;c--){this._titleList[c]=this._titleList[c-1];this._contentList[c]=this._contentList[c-1]}this._contentList[e]=f;this._titleList[e]=this._capturedElement}},getSelectedItem:function(){return this.selectedItem},_getSelectedItem:function(c){var b=this.length();while(b){b--;if(this._titleList[b]===c){this._selectedItem=this.selectedItem=b;break}}},_moveElement:function(d){var c=d.data;if(c._tabCaptured){if(document.selection){document.selection.clear()}if(!c._dragStarted){var b=-parseInt(c._unorderedListHelper.css("left"),10);if(d.clientX+b>c._startX+3||d.clientX+be.offset().left+c._width(this._headerWrapper)){this._scrollRight(this.scrollAnimationDuration);this._capturedElement.style.left=parseInt(a(this._capturedElement).css("left"),10)+this._lastUnorderedListPosition-b}else{c._stop(c._unorderedListHelper);this._unlockAnimation("unorderedList");clearTimeout(this._scrollTimeout)}}this._scrollTimeout=setTimeout(function(){c._dragScroll(d)},this.scrollAnimationDuration);this._lastUnorderedListPosition=b},_captureElement:function(d,c){if(!this._tabCaptured&&!this._titleList[c].locked&&this._titleList[c].disabled!==true&&!this._activeAnimation()){var b=-parseInt(this._unorderedListHelper.css("left"),10);this._startX=b+d.clientX;this._startY=d.clientY;this._lastX=d.clientX;this._lastY=d.clientY;this._tabCaptured=true;this._capturedElement=this._titleList[c]}},_titleInteractionTrigger:function(b){if(this._headerExpandingBalance>0){this._removeOppositeBorder()}if(this._selectedItem!==b){this.select(this._titleList[b],"toggle");this._titleList[b].collapsed=false;if(!this.collapsible){if(this.height!=="auto"){this._contentWrapper.style.visibility="visible"}else{this._contentWrapper.style.display="block"}}}else{if(this.collapsible){if(this.isCollapsed){this.expand()}else{this.collapse()}}}},collapse:function(){var b=this._selectedItem,c=this;this.isCollapsed=true;if(c.height!=="auto"){c._contentWrapper.style.visibility="hidden"}else{c._contentWrapper.style.display="none"}c._raiseEvent(13,{item:b});if(this.position==="top"){c._headerWrapper.className+=" "+this.toThemeProperty("jqx-tabs-header-collapsed");c.element.className+=" "+this.toThemeProperty("jqx-tabs-collapsed")}else{c._headerWrapper.className+=" "+this.toThemeProperty("jqx-tabs-header-collapsed-bottom");c.element.className+=" "+this.toThemeProperty("jqx-tabs-collapsed-bottom")}},expand:function(){var b=this._selectedItem,c=this;this.isCollapsed=false;this._select(b,c.contentTransitionDuration,null,false,true);if(c.height!=="auto"){c._contentWrapper.style.visibility="visible"}else{c._contentWrapper.style.display="block"}c._raiseEvent(14,{item:b});if(this.position==="top"){c._removeClass(c._headerWrapper,c.toThemeProperty("jqx-tabs-header-collapsed"));c._removeClass(c.element,c.toThemeProperty("jqx-tabs-collapsed"))}else{c._removeClass(c._headerWrapper,c.toThemeProperty("jqx-tabs-header-collapsed-bottom"));c._removeClass(c.element,c.toThemeProperty("jqx-tabs-collapsed-bottom"))}},_addSelectHandler:function(b){var c=this;this.addHandler(this._titleList[b],"selectstart",function(){return false});this.addHandler(this._titleList[b],this.toggleMode,(function(d){return function(){c._raiseEvent("15",{item:d});if(!c._tabCaptured&&!c._cancelClick){c._titleInteractionTrigger(d)}return true}}(b)))},_addDragDropHandlers:function(b){var c=this;this.addHandler(this._titleList[b],"mousedown",function(d){c._captureElement(d,b)});this.addHandler(this._titleList[b],"mouseup",function(d){if(c._tabCaptured&&c._dragStarted){c._cancelClick=true;c._uncapture(d,b)}else{c._cancelClick=false}c._tabCaptured=false;return false})},_removeHoverStates:function(){var b=this;a.each(this._titleList,function(){b._removeClass(this,b.toThemeProperty("jqx-tabs-title-hover-top jqx-tabs-title-hover-bottom"))})},_addHoverHandlers:function(b){var d=this;var c=this._titleList[b];this.addHandler(c,"mouseenter mouseleave",function(g){if(b!==d._selectedItem){var f="jqx-fill-state-hover";if(d.position==="top"){f+=" jqx-tabs-title-hover-top"}else{f+=" jqx-tabs-title-hover-bottom"}if(g.type==="mouseenter"){c.className+=" "+d.toThemeProperty(f)}else{d._removeClass(c,d.toThemeProperty(f))}if(d.showCloseButtons){var e=d._closeButtonList[b];if(g.type==="mouseenter"){e.className+=" "+d.toThemeProperty("jqx-tabs-close-button-hover",true)}else{d._removeClass(e,d.toThemeProperty("jqx-tabs-close-button-hover",true))}}}})},_addEventListenerAt:function(c){var d=this;if(this._titleList[c].disabled){return}if(this.reorder&&!this._isTouchDevice){this._addDragDropHandlers(c)}this._addSelectHandler(c);if(this.enabledHover){this._addHoverHandlers(c)}var b=d._closeButtonList[c];this.removeHandler(b,"click");this.addHandler(b,"click",function(){d.removeAt(c);return false})},_removeEventHandlers:function(){var c=this;var b=c.length();while(b){b--;c._removeEventListenerAt(b)}if(c.scrollable){c.removeHandler(c._leftArrow,"mousedown");c.removeHandler(c._rightArrow,"mousedown")}c.removeHandler(a(document),"mousemove.tab"+c.element.id,c._moveElement);c.removeHandler(a(document),"mouseup.tab"+c.element.id,c._mouseUpScrollDocumentHandler);c.removeHandler(a(document),"mouseup.tab"+c.element.id,c._mouseUpDragDocumentHandler);c.removeHandler(c.host,"keydown")},_removeEventListenerAt:function(b){var c=this;c.removeHandler(c._titleList[b],c.toggleMode);c.removeHandler(c._titleList[b],"mouseenter");c.removeHandler(c._titleList[b],"mouseleave");c.removeHandler(c._titleList[b],"mousedown");c.removeHandler(c._titleList[b],"mouseup");c.removeHandler(c._closeButtonList[b],"click")},_moveSelectionTrack:function(n,c,b){var h=this;if(n===-1){return}if(this._titleList.length===0){return}if(n>=this._titleList.length){return}var m=this._titleList[n],o=a(m);h._refreshBarPosition();if(this.selectionTracker&&this._selectionTracker){var i;h._stop(h._selectionTrackerHelper);this._unlockAnimation("selectionTracker");if(b===undefined){i=parseInt(o.position().left,10);if(!isNaN(parseInt(this._unorderedListHelper.css("left"),10))){i+=parseInt(this._unorderedListHelper.css("left"),10)}if(!isNaN(parseInt(this._unorderedListHelper.css("margin-left"),10))){i+=parseInt(this._unorderedListHelper.css("margin-left"),10)}if(!isNaN(parseInt(o.css("margin-left"),10))){i+=parseInt(o.css("margin-left"),10)}if(!isNaN(parseInt(o.css("margin-right"),10))){}}else{i=b}var g=0;var e=0;if(this.position==="top"){g=this._height(h._headerWrapper)-m.offsetHeight;if(!this.autoHeight){e+=parseInt(o.css("margin-top"),10)}}this._lockAnimation("selectionTracker");var l=parseInt(o.css("padding-left"),10)+parseInt(o.css("padding-right"),10);var f=this.position==="top"?0:1;var k=parseInt(a(this._headerWrapper).css("padding-top"),10);var j=parseInt(o.css("padding-top"),10)+parseInt(o.css("padding-bottom"),10);this._selectionTracker.style.visibility="visible";this._moveSelectionTrackerContainer.style.visibility="visible";var d=parseInt(o.css("margin-top"),10);if(isNaN(d)){d=0}h._refreshBarPosition();h._selectionTrackerHelper.animate({top:k+d-f,left:i+"px",height:parseInt(this._height(m)+j,10),width:h._width(m)+l},c,function(){h._unlockAnimation("selectionTracker");h._selectionTracker.style.visibility="hidden";h._addSelectStyle(n,true);h._moveSelectionTrackerContainer.style.visibility="hidden"})}},destroy:function(){a.jqx.utilities.resize(this.host,null,true);if(document.referrer!=""||window.frameElement){if(window.top!=null&&window.top!=window.self){this.removeHandler(a(window.top.document),"mouseup.tabs"+this.element.id)}}this.host.remove()},_switchTabs:function(b,d){if(b!==d&&!this._activeAnimation()&&!this._tabCaptured){var c=this;this._raiseEvent(7,{item:d});this._raiseEvent(6,{item:b});if(this._currentEvent){if(this._currentEvent.cancel){this._currentEvent=null;return}}this._unselect(d,null,true);this._select(b,c.contentTransitionDuration,null,true);return true}return false},_activeAnimation:function(){for(var b in this._isAnimated){if(this._isAnimated.hasOwnProperty(b)){if(this._isAnimated[b]){return true}}}return false},_indexOf:function(c){var b=this.length();while(b){b--;if(this._titleList[b]===c||this._contentList[b]===c){return b}}return -1},_validateProperties:function(){try{if(this.scrollAnimationDuration<0||isNaN(this.scrollAnimationDuration)){throw new Error(this._invalidArgumentExceptions.invalidScrollAnimationDuration)}if(parseInt(this.width,10)<0&&this.width!=="auto"){throw new Error(this._invalidArgumentExceptions.invalidWidth)}if(parseInt(this.height,10)<0&&this.height!=="auto"){throw new Error(this._invalidArgumentExceptions.invalidHeight)}if(this.animationType!=="none"&&this.animationType!=="fade"){throw new Error(this._invalidArgumentExceptions.invalidAnimationType)}if(this.contentTransitionDuration<0||isNaN(this.contentTransitionDuration)){throw new Error(this._invalidArgumentExceptions.invalidcontentTransitionDuration)}if(this.toggleMode!=="click"&&this.toggleMode!=="dblclick"&&this.toggleMode!=="mouseenter"&&this.toggleMode!=="none"){throw new Error(this._invalidArgumentExceptions.invalidToggleMode)}if(this.position!=="top"&&this.position!=="bottom"){throw new Error(this._invalidArgumentExceptions.invalidPosition)}if(this.scrollPosition!=="left"&&this.scrollPosition!=="right"&&this.scrollPosition!=="both"){throw new Error(this._invalidArgumentExceptions.invalidScrollPosition)}if(this.scrollStep<0||isNaN(this.scrollStep)){throw new Error(this._invalidArgumentExceptions.invalidScrollStep)}if(this._titleList.length!==this._contentList.length||this._titleList.length===0){throw new Error(this._invalidArgumentExceptions.invalidStructure)}if(this.arrowButtonSize<0||isNaN(this.arrowButtonSize)){throw new Error(this._invalidArgumentExceptions.invalidArrowSize)}if(this.closeButtonSize<0||isNaN(this.closeButtonSize)){throw new Error(this._invalidArgumentExceptions.invalidCloseSize)}}catch(b){try{console.log(b)}catch(c){}}},_startScrollRepeat:function(d,c){var b=this;if(d){this._scrollLeft(c)}else{this._scrollRight(c)}if(this._scrollTimeout){clearTimeout(this._scrollTimeout)}this._scrollTimeout=setTimeout(function(){b._startScrollRepeat(d,b.scrollAnimationDuration)},c)},_performLayout:function(){var b=this.length();while(b){b--;if(this.position==="top"||this.position==="bottom"){if(this.rtl){this._titleList[b].style["float"]="right"}else{this._titleList[b].style["float"]="left"}}}this._fitToSize();this._performHeaderLayout();this._fitToSize()},updatetabsheader:function(){this._performHeaderLayout()},_setSize:function(){var b=this;b._fitToSize();b._positionArrows(b._totalItemsWidth);if(b._totalItemsWidth>b.element.offsetWidth){b._unorderedList.style.width=b._toPx(b._totalItemsWidth)}else{b._unorderedList.style.width=b.element.offsetWidth-2+"px"}b._fitToSize()},_addArrows:function(){if(this._leftArrow&&this._rightArrow){a(this._leftArrow).remove();a(this._rightArrow).remove()}this._leftArrow=document.createElement("div");this._leftArrow.innerHTML='';this._leftArrow.className=this.toThemeProperty("jqx-tabs-arrow-background jqx-widget-header");this._leftArrow.style.zIndex=30;this._leftArrow.style.display="none";this._leftArrow.style.width=this._toPx(this.arrowButtonSize);this._leftArrow.style.height="100%";this._rightArrow=document.createElement("div");this._rightArrow.innerHTML='';this._rightArrow.className=this.toThemeProperty("jqx-tabs-arrow-background jqx-widget-header");this._rightArrow.style.zIndex=30;this._rightArrow.style.display="none";this._rightArrow.style.width=this._toPx(this.arrowButtonSize);this._rightArrow.style.height="100%";this._headerWrapper.appendChild(this._leftArrow);this._headerWrapper.appendChild(this._rightArrow)},_tabsWithVisibleCloseButtons:function(){if(!this.showCloseButtons){return 0}var b=this.length();a.each(this._titleList,function(){var c=this.attr("hasclosebutton");if(c!==undefined&&c!==null){if(c==="false"||c===false){b--}}});return b},_calculateTitlesSize:function(){var g=this;function f(n,m){if(n){if(m){n.style.display="block"}else{n.style.display="none"}}}var l=0;var k=0;var h=this.length();if(this.rtl&&a.jqx.browser.msie&&a.jqx.browser.version<8){this._measureItem=document.createElement("span");this._measureItem.style.position="relative";this._measureItem.style.visibility="hidden";document.body.appendChild(this._measureItem)}while(h){h--;var j=this._titleList[h],b=g._closeButtonList[h];if(this._measureItem){this._measureItem.innerHTML=j.innerHTML;this._measureItem.html(this._titleList[h].html());j.style.width=g._toPx(g._width(this._measureItem))}j.style.position="static";f(b,false);k+=g._outerWidth(j,true);var e=g._outerHeight(j,true);if(l1)){d=false;if(this.hiddenCloseButtons){if(this.hiddenCloseButtons[h]===1){f(b,false);d=true}}if(!d){k+=this.closeButtonSize;f(b,true)}}}j.style.height=this._toPx(g._height(j))}if(this._measureItem){a(this._measureItem).remove()}return{height:l,width:10+k}},_reorderHeaderElements:function(){if(this.selectionTracker){this._moveSelectionTrackerContainer.style.position="absolute";this._moveSelectionTrackerContainer.style.height="100%";this._moveSelectionTrackerContainer.style.top="0px";this._moveSelectionTrackerContainer.style.left="0px";this._moveSelectionTrackerContainer.style.width="100%"}this._headerWrapper.style.position="relative";this._headerWrapper.style.left="0px";this._headerWrapper.style.top="0px";if(this.scrollable){this._rightArrow.style.width=this._toPx(this.arrowButtonSize);this._rightArrow.style.position="absolute";this._rightArrow.style.top="0px";this._leftArrow.style.width=this._toPx(this.arrowButtonSize);this._leftArrow.style.position="absolute";this._leftArrow.style.top="0px";var c=this.theme&&this.theme.indexOf("ui-")!==-1?3:0;if(c>0){this._rightArrow.className+=" "+this.toThemeProperty("jqx-rc-r");this._leftArrow.className+=" "+this.toThemeProperty("jqx-rc-l")}var b=this.scrollPosition;if(this.rtl){if(b==="left"){b="right"}if(b==="right"){b="left"}}switch(b){case"both":this._rightArrow.style.right="0px";this._leftArrow.style.left="0px";break;case"left":this._rightArrow.style.left=this._toPx(this.arrowButtonSize);this._leftArrow.style.left="0px";break;case"right":this._rightArrow.style.right=this._toPx(-c);this._leftArrow.style.right=this._toPx(parseInt(this.arrowButtonSize,10)-c);break}}},_positionArrows:function(b){if(b>=this._headerWrapper.offsetWidth&&this.scrollable){this._needScroll=true;if(this._unorderedListHelper.position().left===0){this._unorderedListLeftBackup=this._getArrowsDisplacement()+"px"}this._leftArrow.style.display="block";this._rightArrow.style.display="block"}else{this._needScroll=false;this._leftArrow.style.display="none";this._rightArrow.style.display="none";this._unorderedList.style.left="0px"}},_performHeaderLayout:function(){this._removeSelectStyle();var b=this._calculateTitlesSize();var e=b.height;var c=b.width;this._headerWrapper.style.height=this._toPx(e);this._unorderedList.style.height=this._toPx(e);if(this.headerHeight!==null&&this.headerHeight!=="auto"){this._headerWrapper.style.height=this._toPx(this.headerHeight);this._unorderedList.style.height=this._toPx(this.headerHeight)}var d=this._width(this.element);if(c>d){this._unorderedList.style.width=this._toPx(c)}else{this._unorderedList.style.width=this._toPx(d)}if(a.jqx.browser.msie&&a.jqx.browser.version<8){this._unorderedList.style.position="relative";this._unorderedList.style.overflow="hidden"}this._reorderHeaderElements();c=c+parseInt(this._unorderedListHelper.css("margin-left"),10);this._totalItemsWidth=c;this._positionArrows(c);this._unorderedList.style.position="relative";this._unorderedList.style.top="0px";this._verticalAlignElements();this._moveSelectionTrack(this._selectedItem,0);this._addSelectStyle(this.selectedItem)},_verticalAlignElements:function(){var j=this.length();while(j){j--;var n=this._titleList[j],p=a(n),b=p.children()[0],m=this._closeButtonList[j],k=parseInt(p.css("padding-top"),10);if(!k){k=0}if(this.autoHeight){var c=parseInt(p.css("padding-top"),10),o=parseInt(p.css("padding-bottom"),10),i=p.css("border-top-width"),f=p.css("border-bottom-width");if(i.indexOf("px")===-1){i=1}else{i=parseInt(i,10)}if(f.indexOf("px")===-1){f=1}else{f=parseInt(f,10)}n.style.height=this._toPx(this._outerHeight(this._unorderedList,true)-(c+o+i+f))}else{if(this.position==="top"){var h=this._height(this._unorderedList)-parseInt(this._outerHeight(n,true),10);if(parseInt(p.css("margin-top"),10)!==h&&h!==0){n.style.marginTop=this._toPx(h)}}else{n.style.height=this._toPx(this._height(n))}}b.style.height="100%";var e=this._height(n);if(m){var g=e/2-this._height(m)/2;m.style.marginTop=this._toPx(1+g)}var l=e/2-this._height(b)/2;b.style.marginTop=this._toPx(l)}if(this.scrollable){var d=(parseInt(this._headerWrapper.offsetHeight,10)-this.arrowButtonSize)/2;a(this._rightArrow).children()[0].style.marginTop=this._toPx(d);this._rightArrow.style.height="100%";a(this._leftArrow).children()[0].style.marginTop=this._toPx(d);this._leftArrow.style.height="100%"}},_getImageUrl:function(c){var b=c.css("background-image");b=b.replace('url("',"");b=b.replace('")',"");b=b.replace("url(","");b=b.replace(")","");return b},_fitToSize:function(){var c=false;var e=false;var d=this;if(d.width!==null&&d.width.toString().indexOf("%")!==-1){c=true}if(d.height!==null&&d.height.toString().indexOf("%")!==-1){e=true}if(c){this.element.style.width=this.width;this._contentWrapper.style.width="100%"}else{d.element.style.width=d._toPx(d.width);if(this.width!=="auto"){this._contentWrapper.style.width="100%"}}var b;if(e){this.element.style.height=this.height;this._contentWrapper.style.width="100%";this._contentWrapper.style.height="auto";b=this.element.offsetHeight-this._headerWrapper.offsetHeight-2;this._contentWrapper.style.height=b+"px"}else{if(this.height!=="auto"){d.element.style.height=d._toPx(d.height);b=this._height(d.element)-this._headerWrapper.offsetHeight;this._contentWrapper.style.height=d._toPx(b)}else{this._contentWrapper.style.height="auto"}}},_maxHeightTab:function(){var c=this.length();var d=-1;var b=-1;while(c){c--;if(d0){a(g).find(".jqx-tabs-close-button").remove()}d.style["float"]=f;d.innerHTML=g.innerHTML;g.innerHTML="";var b=document.createElement("div");b.className=this.toThemeProperty("jqx-tabs-close-button");b.style.height=this._toPx(this.closeButtonSize);b.style.width=this._toPx(this.closeButtonSize);b.style["float"]=f;b.style.fontSize="1px";g.appendChild(d);g.appendChild(b);if(e===true){this._closeButtonList[c]=b}else{this._closeButtonList.splice(c,0,b)}if(!this.showCloseButtons){b.style.display="none"}else{if(this.hiddenCloseButtons){if(this.hiddenCloseButtons[c]===1){b.style.display="none"}}}},_addCloseButtons:function(){var b=this.length();while(b){b--;this._addCloseButton(b,true)}},_prepareTabs:function(){var c=this.length();var b=this.selectionTracker;this.selectionTracker=false;while(c){c--;if(this._selectedItem!==c){this._unselect(c,null,false)}}this._select(this._selectedItem,0,null,false);this.selectionTracker=b;if(this.initTabContent){if(!this._initTabContentList[this.selectedItem]){if(!this._hiddenParent()){this.initTabContent(this.selectedItem);this._initTabContentList[this.selectedItem]=true}}}},_isValidIndex:function(b){return(b>=0&&b=0&&f!==undefined){var c=null;if(this.showCloseButtons){c=this._closeButtonList[d];if(this.hiddenCloseButtons){if(this.hiddenCloseButtons[d]===1){c=null}}}var b="jqx-fill-state-hover",e=" jqx-fill-state-pressed";if(this.position==="top"){b+=" jqx-tabs-title-hover-top";e+=" jqx-tabs-title-selected-top"}else{b+=" jqx-tabs-title-hover-bottom";e+=" jqx-tabs-title-selected-bottom"}this._removeClass(f,this.toThemeProperty(b));f.className+=this.toThemeProperty(e);if(c!==null){c.className+=" "+this.toThemeProperty("jqx-tabs-close-button-selected")}}}},_addItemTo:function(g,c,e){if(c");a(this._headerWrapper).append(b);b.addClass(this.toThemeProperty("jqx-tabs-bar"));this.bar=b}setTimeout(function(){var d=parseInt(c._unorderedListHelper.css("left"),10);var e=parseInt(c._unorderedListHelper.css("margin-left"));c.bar.css("left",e+c._titleList[c._selectedItem].offsetLeft+d);c.bar.width(a(c._titleList[c._selectedItem]).outerWidth()-2)})},_select:function(h,e,l,b,c){if(!this._tabCaptured){this.host.attr("hideFocus","true");var g=this;if(c===undefined){this._addSelectStyle(h)}else{this._addSelectStyle(h,c)}var k=a(g._titleList[h]),d=g._titleList[h].getAttribute("id"),j=a(g._contentList[h]);if(this.isCollapsed&&this.collapsible){j[0].style.display="none";this._selectCallback(h,l,b);return}g._refreshBarPosition();switch(this.animationType){case"none":if(!g.selectionTracker){for(var f=0;f=0){if(!this._tabCaptured){var g=this,e=g._contentList[d],c=a(e),h=g._titleList[d],f=a(h);if(c.initAnimate&&c.animate===undefined){c.initAnimate()}g._stop(c);if(this.animationType==="fade"){e.style.display="none";a.jqx.aria(f,"aria-selected",false);a.jqx.aria(c,"aria-hidden",true)}else{if(this.selectionTracker){setTimeout(function(){e.style.display="none";a.jqx.aria(f,"aria-selected",false);a.jqx.aria(c,"aria-hidden",true)},this.selectionTrackerAnimationDuration)}else{e.style.display="none";a.jqx.aria(f,"aria-selected",false);a.jqx.aria(c,"aria-hidden",true)}}this._unselectCallback(d,i,b);if(!this.selectionTracker){g._removeClass(h,g.toThemeProperty("jqx-tabs-title-selected jqx-fill-state-pressed"))}}}},_unselectCallback:function(c,d,b){if(b){this._raiseEvent(8,{item:c})}if(d){d()}},disable:function(){var b=this.length();while(b){b--;this.disableAt(b)}},enable:function(){var b=this.length();while(b){b--;this.enableAt(b)}},getEnabledTabsCount:function(){var b=0;a.each(this._titleList,function(){if(!this.disabled){b++}});return b},getDisabledTabsCount:function(){var b=0;a.each(this._titleList,function(){if(this.disabled){b++}});return b},removeAt:function(b){if(this._isValidIndex(b)&&(this.canCloseAllTabs||this.length()>1)){this._removeHoverStates();var d=this,c=d._outerWidth(this._titleList[b],true),g=this.getTitleAt(b);this._unorderedList.style.width=d._toPx(d._width(this._unorderedList)-c);a(this._titleList[b]).remove();a(this._contentList[b]).remove();this._titleList.splice(b,1);this._contentList.splice(b,1);d._closeButtonList.splice(b,1);this._addStyles();this._performHeaderLayout();this._removeEventHandlers();this._addEventHandlers();this._raiseEvent(3,{item:b,title:g});this._isAnimated={};var f;if(this.selectedItem>0){this._selectedItem=-1;if(this.selectedItem>=b){f=this._getPreviousIndex(this.selectedItem);this.select(f)}else{this.select(d.selectedItem)}}else{this._selectedItem=-1;f=this._getNextIndex(this.selectedItem);this.select(f)}if(parseInt(this._unorderedListHelper.css("left"),10)>this._getArrowsDisplacement()){this._unorderedList.style.left=d._toPx(this._getArrowsDisplacement())}if(d._width(this._unorderedList)<=d._width(this._headerWrapper)){var e=(this.enableScrollAnimation)?this.scrollAnimationDuration:0;this._lockAnimation("unorderedList");this._unorderedListHelper.animate({left:0},e,function(){d._unlockAnimation("unorderedList")})}}},removeFirst:function(){this.removeAt(0)},removeLast:function(){this.removeAt(this.length()-1)},disableAt:function(b){var d=this._titleList[b];if(!d.disabled||d.disabled===undefined){if(this.selectedItem===b){var c=this.next();if(!c){c=this.previous()}}d.disabled=true;this.removeHandler(d,this.toggleMode);if(this.enabledHover){a(d).off("mouseenter").off("mouseleave")}this._removeEventListenerAt(b);d.className+=" "+this.toThemeProperty("jqx-tabs-title-disable jqx-fill-state-disabled");this._raiseEvent(5,{item:b})}},enableAt:function(b){var c=this._titleList[b];if(c.disabled){c.disabled=false;this._addEventListenerAt(b);this._removeClass(c,this.toThemeProperty("jqx-tabs-title-disable jqx-fill-state-disabled"));this._raiseEvent(4,{item:b})}},addAt:function(d,g,e){if(d>=0&&d<=this.length()){this._removeHoverStates();var b=document.createElement("li");b.innerHTML=g;b.className=this.toThemeProperty("jqx-tabs-title jqx-item");var f=document.createElement("div");f.innerHTML=e;f.className=this.toThemeProperty("jqx-tabs-content-element");if(this.position==="bottom"){b.className+=" "+this.toThemeProperty("jqx-tabs-title-bottom")}var c=false;if(this._titleList.length===0){this._unorderedList.appendChild(b)}else{if(d=0){this._unorderedList.insertBefore(b,this._titleList[d])}else{this._unorderedList.appendChild(b)}}this._contentWrapper.appendChild(f);this._addItemTo(this._titleList,d,b);this._addItemTo(this._contentList,d,f);this._addCloseButton(d);if(this._selectedItem>d){this._selectedItem++}this._switchTabs(d,this._selectedItem);this._selectedItem=d;this._uiRefresh(c);this._raiseEvent(2,{item:d});this._moveSelectionTrack(this._selectedItem,0)}},addFirst:function(c,b){this.addAt(0,c,b)},addLast:function(c,b){this.addAt(this.length(),c,b)},val:function(b){if(arguments.length===0||typeof(b)==="object"){return this._selectedItem}this.select(b);return this._selectedItem},select:function(b){if(typeof(b)==="object"){b=this._indexOf(b)}var d=b>=0&&b0&&b0&&c<=this._titleList.length){c--;if(!this._titleList[c].disabled){return c}}return b}else{return 0}},_getNextIndex:function(c){if(c!==undefined&&!isNaN(c)){var b=c;while(c>=0&&c=0&&bb-this._getArrowsDisplacement()){h=-l+k-f-((this.scrollable)?(2*this.arrowButtonSize-this._getArrowsDisplacement()):0);c=k-f-this._getArrowsDisplacement()}else{this._moveSelectionTrack(e,this.selectionTrackerAnimationDuration);return true}}this._lockAnimation("unorderedList");this._unorderedListHelper.animate({left:h},this.scrollAnimationDuration,function(){d._unlockAnimation("unorderedList");d._moveSelectionTrack(d._selectedItem,0);return true});this._moveSelectionTrack(e,this.selectionTrackerAnimationDuration,c);return true},isVisibleAt:function(d){var c=this;if(d===undefined||d===-1||d===null){d=c.selectedItem}if(!c._isValidIndex(d)){return false}var h=c._titleList[d];var j=parseInt(a(h).position().left,10)+parseInt(c._unorderedListHelper.css("margin-left"),10);var f=parseInt(c._unorderedListHelper.css("left"),10);var i=c._outerWidth(c._headerWrapper,true);var e=c._outerWidth(h,true);var g=f-c._getArrowsDisplacement();var b=i-c._getArrowsDisplacement()-g;if(j<-g){return false}else{if(j+e>b){return false}else{return true}}return true},isDisabled:function(b){return this._titleList[b].disabled},_lockAnimation:function(b){if(this._isAnimated){this._isAnimated[b]=true}},_unlockAnimation:function(b){if(this._isAnimated){this._isAnimated[b]=false}},propertiesChangedHandler:function(d,b,c){if(c&&c.width&&c.height&&Object.keys(c).length===2){d._setSize()}},propertyChangedHandler:function(b,c,e,d){if(b.batchUpdate&&b.batchUpdate.width&&b.batchUpdate.height&&Object.keys(b.batchUpdate).length===2){return}this._validateProperties();switch(c){case"touchMode":if(d){b.enabledHover=false;b.keyboardNavigation=false}break;case"width":case"height":b._setSize();return;case"disabled":if(d){this.disable()}else{this.enable()}return;case"showCloseButtons":if(d){this.showAllCloseButtons()}else{this.hideAllCloseButtons()}this._performHeaderLayout();return;case"selectedItem":if(this._isValidIndex(d)){this.select(d)}return;case"scrollStep":case"contentTransitionDuration":case"scrollAnimationDuration":case"enableScrollAnimation":return;case"selectionTracker":if(d){this._refresh();this.select(this._selectedItem)}else{if(this._selectionTracker){this._selectionTrackerHelper.remove()}}return;case"scrollable":if(d){this._refresh();this.select(this._selectedItem)}else{a(this._leftArrow).remove();a(this._rightArrow).remove();this._performHeaderLayout()}return;case"autoHeight":this._performHeaderLayout();return;case"theme":a.jqx.utilities.setTheme(e,d,this.host);return}this._unorderedList.style.left="0px";this._refresh();this.select(this._selectedItem);this._addSelectStyle(this._selectedItem,true)},_toPx:function(b){if(typeof b==="number"){return b+"px"}else{return b}},_removeClass:function(c,b){a(c).removeClass(b)},_width:function(e){var b=a(e),g=b.css("border-left-width"),c=b.css("border-right-width"),d=parseInt(b.css("padding-left"),10),h=parseInt(b.css("padding-right"),10);if(g.indexOf("px")===-1){g=1}else{g=parseInt(g,10)}if(c.indexOf("px")===-1){c=1}else{c=parseInt(c,10)}var f=e.offsetWidth-(g+c+d+h);return f},_outerWidth:function(c,g){var f=c.offsetWidth;if(g){var b=a(c),d=parseInt(b.css("margin-left"),10),e=parseInt(b.css("margin-right"),10);f+=d+e}return f},_height:function(e){var c=a(e),h=c.css("border-top-width"),d=c.css("border-bottom-width"),f=parseInt(c.css("padding-top"),10),g=parseInt(c.css("padding-bottom"),10);if(h.indexOf("px")===-1){h=1}else{h=parseInt(h,10)}if(d.indexOf("px")===-1){d=1}else{d=parseInt(d,10)}var b=e.offsetHeight-(h+d+f+g);return b},_outerHeight:function(e,g){var f=e.offsetHeight;if(g){var b=a(e),c=parseInt(b.css("margin-top"),10),d=parseInt(b.css("margin-bottom"),10);f+=c+d}return f},_stop:function(b){if(b.stop){b.stop()}else{b.animate("stop",true)}}})}(jqxBaseFramework)); +