-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathibox.min.js
2 lines (2 loc) · 19 KB
/
ibox.min.js
1
2
/*! iBox v2.0.6 ~ (c) 2013 Max Zhang, https://github.com/maxzhang/ibox2 */
(function(){var t=this,e=Array.prototype.slice,i=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"],n=[],s=function(){},o=function(t){s.prototype=t;var e=new s;return s.prototype=null,e},r=function(t,e){if(t&&e&&"object"==typeof e){var n,s,o;for(n in e)t[n]=e[n];if(i)for(s=i.length;s--;)o=i[s],e.hasOwnProperty(o)&&(t[o]=e[o])}},a=function(){};r(a,{$isClass:!0,extend:function(t){var e,i,n,s=t.prototype;if(i=this.prototype=o(s),this.superclass=i.superclass=s,!t.$isClass){e=a.prototype;for(n in e)n in i&&(i[n]=e[n])}},addStatics:function(t){var e,i;for(i in t)t.hasOwnProperty(i)&&(e=t[i],this[i]=e);return this},addMembers:function(t){var e,n,s,o,r=this.prototype,a=[];for(s in t)a.push(s);for(i&&a.push.apply(a,i),e=0,n=a.length;n>e;e++)s=a[e],t.hasOwnProperty(s)&&(o=t[s],"function"!=typeof o||o.$isClass||(o.$owner=this,o.$name=s),r[s]=o);return this},implement:function(){this.addMembers.apply(this,arguments)}}),r(a.prototype,{$isInstance:!0,callParent:function(t){var i,s=(i=this.callParent.caller)&&(i=i.$owner?i:i.caller)&&i.$owner.superclass[i.$name];return s.apply(this,t?e.call(t,0):n)},constructor:function(){return this}});var d=function(){function t(){return this.constructor.apply(this,arguments)||null}return t},l=function(t,e){var i,n,s,o=a.prototype;if(i=e&&e!==Object?e:a,n=i.prototype,!i.$isClass)for(s in o)n[s]||(n[s]=o[s]);t.extend(i)},h={define:function(t,e){var i,n;t||e?e||(e=t,t=a):(t=a,e={}),i=d();for(n in a)i[n]=a[n];return e.statics&&(i.addStatics(e.statics),delete e.statics),l(i,t),i.addMembers(e),i}};"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=h:"function"==typeof define&&(define.amd||seajs)&&define("klass",[],function(){return h}),"object"==typeof t&&"object"==typeof t.document&&(t.Klass=h)})(),function(t){var e=document.createElement("div").style,i=function(){for(var t,i="t,webkitT,MozT,msT,OT".split(","),n=0,s=i.length;s>n;n++)if(t=i[n]+"ransform",t in e)return i[n].substr(0,i[n].length-1);return!1}(),n=i?"-"+i.toLowerCase()+"-":"",s=function(t){return""===i?t:(t=t.charAt(0).toUpperCase()+t.substr(1),i+t)},o=s("transform"),r=s("transition"),a=s("transitionProperty"),d=s("transitionDuration"),l=s("transformOrigin"),h=s("transitionTimingFunction"),c=s("transitionDelay"),u=function(){return"webkit"==i||"O"===i?i.toLowerCase()+"TransitionEnd":"transitionend"}();e=null,t.vendor={propPrefix:i,cssPrefix:n,transform:o,transition:r,transitionProperty:a,transitionDuration:d,transformOrigin:l,transitionTimingFunction:h,transitionDelay:c,transitionEndEvent:u}}(window),function(t){var e=t.vendor,i=Array.prototype.slice,n=/Android/i.test(t.navigator.userAgent);t.adapter={createOrientationChangeProxy:function(e,s){return s===void 0&&(s=e),function(){clearTimeout(s.orientationChangedTimeout);var o=i.call(arguments,0);s.orientationChangedTimeout=setTimeout(function(){var i=t.orientation;i!=s.lastOrientation&&e.apply(s,o),s.lastOrientation=i},n?300:50)}},listenTransition:function(t,i,n){var s=this,o=function(){t.transitionTimer&&clearTimeout(t.transitionTimer),t.transitionTimer=null,t.removeEventListener(e.transitionEndEvent,r,!1)},r=function(){o(),n&&n.call(s)};o(),t.addEventListener(e.transitionEndEvent,r,!1),t.transitionTimer=setTimeout(r,i+100)}}}(window),function(t){var e=t.navigator,i=e.userAgent,n=i.match(/(Android)\s([\d\.]+)/i),s=i.match(/(iPad|iPhone|iPod);[\w\s]+(?:iPhone|)\sOS\s([\d_\.]+)/i),o=i.match(/(Windows\s+Phone)(?:\sOS)?\s([\d\.]+)/i),r=/WebKit\/[\d.]+/i.test(i),a=s?e.standalone?r:/Safari/i.test(i)&&!/CriOS/i.test(i)&&!/MQQBrowser/i.test(i):!1,d={};n&&(d.android=!0,d.version=n[2],d.android4=/^4/.test(d.version),d.android3=/^3/.test(d.version),d.android2=/^2/.test(d.version)),s&&(d.ios=!0,d.version=s[2].replace(/_/g,"."),d["ios"+d.version.match(/^(\w+)/i)[1]]=!0,"iPad"===s[1]?d.ipad=!0:"iPhone"===s[1]?d.iphone=!0:"iPod"===s[1]&&(d.ipod=!0)),o&&(d.wp=!0,d.version=o[2],d.wp8=/^8/.test(d.version),d.wp7=/^7/.test(d.version)),t.supporter={os:d,isSmartDevice:function(){return!!(d.ios||d.android||d.wp)}(),isWebkit:r,isSafari:a,isBelowIos7:!!(d.ios&&7>d.version.match(/^(\w+)/i)[1])}}(window),function(t){var e=t.navigator,i=t.adapter,n=t.supporter,s=function(e,i,n){var s=typeof e;return"undefined"===s?i:"function"===s?e.call(n||t):e};t.resizer=function(){function o(){clearTimeout(a),a=setTimeout(function(){a=null,r()},100)}function r(){var i,o,r,a,h,c,u,p,f=t.innerWidth,y=t.innerHeight,m=t.screen.width,g=t.screen.height,v=f;n.isSafari&&n.isBelowIos7?(i=e.standalone?y:(0===t.orientation?g-44:m-32)-20,i=y>i?y:i):i=y,(v!=d.width||i!=d.height)&&(d.width=v,d.height=i,l.forEach(function(e){c=e.fn,c&&(u=e.scope,p=e.options||{},o=s(p.offsetLeft,0,u),r=s(p.offsetRight,0,u),a=s(p.offsetTop,0,u),h=s(p.offsetBottom,0,u),c.call(u||t,v-o-r,i-a-h))}))}var a,d,l=[];return d={on:function(t,e,i){return l.push({fn:t,scope:e,options:i}),d},off:function(t,e){return l.every(function(i,n){return i.fn===t&&i.scope===e?(l.splice(n,1),!1):void 0}),d},trigger:function(){return o(),d}},t.addEventListener("resize",o,!1),t.addEventListener("orientationchange",i.createOrientationChangeProxy(r),!1),o(),d}()}(window),function(t){var e=Object.prototype.toString,i=Array.prototype.slice,n={BLANK_IMAGE:"data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",noop:function(){},isDefined:function(t){return t!==void 0},isString:function(t){return"string"==typeof t},isBoolean:function(t){return"boolean"==typeof t},isObject:"[object Object]"===e.call(null)?function(t){return null!==t&&void 0!==t&&"[object Object]"===e.call(t)&&void 0===t.ownerDocument}:function(t){return"[object Object]"===e.call(t)},isArray:"isArray"in Array?Array.isArray:function(t){return"[object Array]"===e.call(t)},isFunction:function(t){return"[object Function]"===e.call(t)},result:function(e,i,s){return n.isDefined(e)?n.isFunction(e)?e.call(s||t):e:i},proxy:function(t,e){return function(){return t.apply(e,arguments)}},removeElement:function(){var t=i.call(arguments,0);t.forEach(function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})},addClass:function(t,e){var i,n,s,o;if(i=(e||"").match(/\S+/g)||[],n=1===t.nodeType&&(t.className?(" "+t.className+" ").replace(/[\t\r\n]/g," "):" ")){for(o=0;s=i[o++];)0>n.indexOf(" "+s+" ")&&(n+=s+" ");t.className=n.trim()}},removeClass:function(t,e){var i,n,s,o;if(i=(e||"").match(/\S+/g)||[],n=1===t.nodeType&&(t.className?(" "+t.className+" ").replace(/[\t\r\n]/g," "):" ")){for(o=0;s=i[o++];)for(;n.indexOf(" "+s+" ")>=0;)n=n.replace(" "+s+" "," ");t.className=n.trim()}},parsePx:function(t){return t?parseInt(t.replace(/[^\d]/g,""),10):0},getComputedSize:function(e,i){var s,o,r,a,d,l,h=t.getComputedStyle(e,null);return n.isDefined(i)?(n.isObject(i)||(i={width:i}),d=i.width,l=i.height,n.isDefined(d)&&(s=d-n.parsePx(h.marginLeft)-n.parsePx(h.marginRight),r=s-n.parsePx(h.paddingLeft)-n.parsePx(h.paddingRight)-n.parsePx(h.borderLeftWidth)-n.parsePx(h.borderRightWidth)),n.isDefined(l)&&(o=l-n.parsePx(h.marginTop)-n.parsePx(h.marginBottom),a=o-n.parsePx(h.paddingTop)-n.parsePx(h.paddingBottom)-n.parsePx(h.borderTopWidth)-n.parsePx(h.borderBottomWidth))):(s=e.offsetWidth,o=e.offsetHeight,r=s-n.parsePx(h.paddingLeft)-n.parsePx(h.paddingRight)-n.parsePx(h.borderLeftWidth)-n.parsePx(h.borderRightWidth),a=o-n.parsePx(h.paddingTop)-n.parsePx(h.paddingBottom)-n.parsePx(h.borderTopWidth)-n.parsePx(h.borderBottomWidth),d=s+n.parsePx(h.marginLeft)+n.parsePx(h.marginRight),l=o+n.parsePx(h.marginTop)+n.parsePx(h.marginBottom)),{width:0>s?0:s,height:0>o?0:o,innerWidth:0>r?0:r,innerHeight:0>a?0:a,outerWidth:0>d?0:d,outerHeight:0>l?0:l}},queryFunction:function(e){var i;return e&&n.isString(e)&&(i=t,e=e.split("."),e.forEach(function(t){i=i[t]})),i||n.noop},dispatchClickEvent:function(t){var e,i=t.target;"SELECT"!=i.tagName&&"INPUT"!=i.tagName&&"TEXTAREA"!=i.tagName&&(e=document.createEvent("MouseEvents"),e.initMouseEvent("click",!0,!0,t.view,1,i.screenX,i.screenY,i.clientX,i.clientY,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,0,null),e._constructed=!0,i.dispatchEvent(e))}};t.iBoxUtils=n}(window),function(t){var e=Array.prototype.slice,i=t.supporter,n=t.resizer,s=t.iBoxUtils,o=Klass.define({statics:{version:"2.0.6"},baseCSSPrefix:"ibox",offsets:{top:0,bottom:0},constructor:function(t,e){s.isObject(t)&&(e=t,t=null),t=t||document.body,e=e||{};for(var i in e)this[i]=e[i];this.views={},this.render(t),this.scrollTop(),n.on(this.resize,this).trigger();var o=this.body.children[0];o&&this.slide({el:o,silent:!0})},render:function(t){if(!this.rendered){this.rendered=!0;var e=this.baseCSSPrefix,i=this.baseCSSPrefix+"-header",n=this.baseCSSPrefix+"-body";this.el=s.isString(t)?document.querySelector(t):t,s.addClass(this.el,e),this.cls&&s.addClass(this.el,this.cls),this.header=this.el.querySelector("."+i),this.header||(this.header=document.createElement("div"),this.el.appendChild(this.header)),s.addClass(this.header,i),this.headerCls&&s.addClass(this.header,this.headerCls),this.body=this.el.querySelector("."+n),this.body||(this.body=document.createElement("div"),this.el.appendChild(this.body)),s.addClass(this.body,n),this.bodyCls&&s.addClass(this.body,this.bodyCls),this.onRender()}},onRender:s.noop,resize:function(){var t,e,i,o,r=n.width,a=n.height,d=s.result(this.offsets.top,0,this),l=s.result(this.offsets.bottom,0,this);a=a-d-l,t=s.getComputedSize(this.el,{width:r,height:a}),o=s.getComputedSize(this.header).outerHeight,e=s.getComputedSize(this.header,{width:t.innerWidth,height:o}),i=s.getComputedSize(this.body,{width:t.innerWidth,height:t.innerHeight-o}),this.scrollTop(),this.el.style.cssText="top:"+d+"px;width:"+t.innerWidth+"px;height:"+t.innerHeight+"px;",this.header.style.cssText="top:0px;width:"+e.innerWidth+"px;height:"+e.innerHeight+"px;",this.body.style.cssText="top:"+o+"px;width:"+i.innerWidth+"px;height:"+i.innerHeight+"px;",this.lastView&&!this.sliding&&this.lastView.resize(),this.onResize(t,e,i)},onResize:s.noop,slide:function(t,i,n,r){var a,d=this,l=e.call(arguments,0),h=l.length,c=d.lastView;d.scrollTop(),t&&(2!=h||s.isBoolean(i)||(r=i,i=!1),3!=h||s.isBoolean(n)||(r=n,n=!1),t=s.isString(t)?{id:t}:t,t.id=t.id&&(s.isString(t.id)?t.id:t.id.getAttribute("id")),n=n===!0,i=i===!0,r=r||{},a=d.views[t.id],a||(a=new o.View(d.body,d.header,t),d.views[a.id]=a),c==a||d.sliding||(d.sliding=!0,c?(r.beforeHide&&r.beforeHide(c),c.slide(i,"out",n,function(){r.onHide&&r.onHide(c),c.single!==!0&&(c.destroy(),delete d.views[c.id])})):n=!0,r.beforeShow&&r.beforeShow(a),a.slide(i,"in",n,function(){d.lastView=a,r.onShow&&r.onShow(a),d.sliding=!1,d.resize()})))},scrollTop:function(){i.isSafari&&t.scrollTo(0,1)},beforeDestroy:s.noop,onDestroy:s.noop,destroy:function(){if(!this.destroyed){this.destroyed=!0,this.beforeDestroy(),n.off(this.resize,this);for(var t in this.view)this.views[t].destroy(),delete this.views[t];this.views=this.lastView=null,s.removeElement(this.header,this.body),this.el=this.header=this.body=null,this.onDestroy()}}});(function(){function e(t){for(var e,i=document.querySelector("meta[name=viewport]"),n=i.content,s=n.split(","),o=[],r="width",a=0,d=s.length;d>a;a++)e=s[a].trim().split("="),e[0]==r?o.push(r+"="+t):o.push(e[0]+"="+e[1]);n=o.join(", "),-1==n.indexOf(r+"=")&&(n=r+"="+t+", "+n),i.content=n}i.os.ios7||528!==t.screen.height?e("device-width"):e("320.1")})(),"function"==typeof define&&(define.amd||seajs)&&define("ibox",[],function(){return o}),t.iBox=o}(window),function(t){var e=t.IScroll,i=t.vendor,n=t.adapter,s=t.iBoxUtils,o=Klass.define({statics:{idSeed:1e3},iscroll:{scrollX:!1,scrollY:!0,preventDefault:!0,click:!0},constructor:function(t,e,i){i=i||{};for(var n in i)this[n]=i[n];this.headerKlass=this.headerKlass||iBox.GeneralHeader,this.ct=t,this.headerCt=e,this.render()},makeId:function(){return"ibox-view-gen"+ ++o.idSeed},render:function(){this.rendered||(this.rendered=!0,this.el?(this.el=s.isString(this.el)?document.querySelector(this.el):this.el,this.scroller=this.el.children[0],this.id=this.el.getAttribute("id"),this.single="false"!==this.el.getAttribute("data-single"),this.onRender=s.queryFunction(this.el.getAttribute("data-render"))):(this.el=document.createElement("div"),this.scroller=document.createElement("div"),this.el.appendChild(this.scroller),this.el.style.cssText="display:none;",this.ct.appendChild(this.el)),this.id||(this.id=this.makeId()),s.addClass(this.scroller,"scroller"),this.el.setAttribute("id",this.id),s.addClass(this.el,"ibox-view"),this.cls&&s.addClass(this.el,this.cls),s.isString(this.header)&&(this.header={title:this.header}),this.header=new this.headerKlass(this.id,this.headerCt,this.header),this.iscroll!==!1&&e&&(this.iscroll=new e(this.el,this.iscroll)),this.onRender())},onRender:s.noop,slide:function(t,e,o,r){var a,d,l,h,c=this,u=c.ct,p=c.el,f=i.cssPrefix,y=s.getComputedSize(u),m=s.getComputedSize(p,{width:y.outerWidth,height:y.outerHeight}),g=1,v=80,x=350,w=50;c.header.slide(t,e,o),("in"==e&&!t||"out"==e&&t)&&(g=2,l="-5px 0 20px #dddddd"),d="display:block;z-index:"+g+";opacity:"+("in"==e?1:.7)+";"+f+"box-shadow:"+l+";width:"+m.innerWidth+"px;height:"+m.innerHeight+"px;"+f+"transform:translate3d("+("in"==e?"0":t?y.width:-v)+"px,0px,0px);"+(o===!0?"":f+"transition:"+f+"transform "+x+"ms,opacity "+x+"ms;"),h=function(){"in"!=e&&p?p.style.display="none":"in"==e&&c.iscroll&&c.iscroll.refresh(),r&&r.call(c,m),c.onSlide()},o!==!0?("in"==e&&(a="display:block;z-index:"+g+";opacity:"+(t?.5:1)+";"+f+"box-shadow:"+l+";width:"+m.innerWidth+"px;height:"+m.innerHeight+"px;"+f+"transform:translate3d("+(t?-v:y.width)+"px,0px,0px);",p.style.cssText=a),n.listenTransition(p,x+w,h),setTimeout(function(){p.style.cssText=d},w)):(p.style.cssText=d,h())},onSlide:s.noop,resize:function(){var t=this;t.slide(!1,"in",!0,function(e){t.onResize(e)})},onResize:s.noop,destroy:function(){this.destroyed||(this.destroyed=!0,this.beforeDestroy(),this.header.destroy(),this.header=null,this.iscroll&&(this.iscroll.destroy(),this.iscroll=null),s.removeElement(this.el),this.el=this.ct=this.headerCt=null,this.onDestroy())},beforeDestroy:s.noop,onDestroy:s.noop});iBox.View=o}(window),function(t){var e=t.iBoxUtils;iBox.Header=Klass.define({constructor:function(t,e,i){i=i||{};for(var n in i)this[n]=i[n];this.viewId=t,this.ct=e,this.render()},render:function(){this.rendered||(this.rendered=!0,this.doRender(),this.onRender())},doRender:e.noop,onRender:e.noop,slide:function(t,e,i,n){var s=this;s.doSlide(t,e,i,function(){n&&n.call(s),s.onSlide()})},doSlide:e.noop,onSlide:e.noop,resize:function(){var t=this;t.slide(!1,"in",!0,function(e){t.onResize(e)})},onResize:e.noop,destroy:function(){this.destroyed||(this.destroyed=!0,this.beforeDestroy(),this.doDestroy(),this.ct=null,this.onDestroy())},doDestroy:e.noop,beforeDestroy:e.noop,onDestroy:e.noop})}(window),function(t){var e=t.navigator.msPointerEnabled,i={start:e?"MSPointerDown":"touchstart",move:e?"MSPointerMove":"touchmove",end:e?"MSPointerUp":"touchend"},n=t.vendor,s=t.supporter,o=t.adapter,r=t.iBoxUtils;iBox.GeneralHeader=Klass.define(iBox.Header,{doRender:function(){var t,e=this.title;e?(e=r.isString(e)?{text:e}:e,t=document.createElement("div"),t.innerHTML="<div>"+e.text+"</div>",t.className="button title"+(e.cls?" "+e.cls:""),t.setAttribute("data-view",this.viewId),t.style.cssText="display:none;",this.ct.appendChild(t),this.title=t,t=null):this.title=this.ct.querySelector('div.title[data-view="'+this.id+'"]'),this.renderButton(this.leftButton,!0),this.renderButton(this.rightButton,!1)},renderButton:function(t,e){var n,o,a,d=this,l=e?"left":"right";t?(t=r.isString(t)?{text:t}:t,o=t.handler,n=document.createElement("div"),n.innerHTML=(e?'<img src="'+(t.icon||r.BLANK_IMAGE+'" class="back"')+" />":"")+"<div>"+t.text+"</div>",n.className="button "+l+(t.cls?" "+t.cls:""),n.style.cssText="display:none;",n.setAttribute("data-view",d.viewId),d.ct.appendChild(n),d[l+"Button"]=a=n,n=null):(d[l+"Button"]=a=d.ct.querySelector("div."+l+'[data-view="'+d.id+'"]'),a&&(o=r.queryFunction(a.getAttribute("data-handler")))),o&&(a.clickHandler=o,s.isSmartDevice&&(a.addEventListener(i.start,this,!1),a.addEventListener(i.end,this,!1)),a.addEventListener("click",this,!1))},onButtonTouchStart:function(t){var e=t.currentTarget;clearTimeout(e.highlightTimeout),r.addClass(e,"highlighted")},onButtonTouchEnd:function(t){r.dispatchClickEvent(t)},onButtonClick:function(t){var e=t.currentTarget;e.highlightTimeout=setTimeout(function(){r.removeClass(e,"highlighted")},300),e.clickHandler&&e.clickHandler()},doSlide:function(t,e,i,s){var a,d,l,h,c,u,p,f,y,m,g,v,x,w,b,T=this,S=n.cssPrefix,C=t?"right":"left",A=T.leftButton,P=T.rightButton,B=T.title,E=r.getComputedSize(T.ct).innerWidth,D=70,k=350,z=300,O=50;"in"==e&&(A&&(A.style.cssText="display:block;"+S+"transform:translate3d(-1000px,-1000px,0px);"),P&&(P.style.cssText="display:block;"+S+"transform:translate3d(-1000px,-1000px,0px);"),B&&(B.style.cssText="display:block;"+S+"transform:translate3d(-1000px,-1000px,0px);")),l=A?r.getComputedSize(A).outerWidth:0,h=P?r.getComputedSize(P).outerWidth:0,d=B?r.getComputedSize(B).outerWidth:0,l+h+d>E&&(l=E-d-h),D>l&&(l=D),c=(E-d)/2,c=c+d+h>E?(E-d-h)/2:c,c=l>c?l:c,A&&(r.removeClass(A,"highlighted"),a=A.querySelector("div"),u=r.getComputedSize(A,l).innerWidth,p=r.getComputedSize(a,u).innerWidth,v="display:block;width:"+u+"px;opacity:"+("in"==e?"1":"0")+";"+(i===!0?"":S+"transition:"+"opacity "+z+"ms;"),x="width:"+p+"px;"+S+"transform:translate3d("+("in"==e?0:"left"==C?-l:c)+"px,0px,0px);"+(i===!0?"":""+S+"transition:"+S+"transform "+k+"ms;"),i!==!0?("in"==e&&(f="display:block;width:"+u+"px;opacity:0;",y="width:"+p+"px;"+S+"transform:translate3d("+("left"==C?c:-l)+"px,0px,0px);",A.style.cssText=f,a.style.cssText=y),o.listenTransition(A,k+O,function(){"in"!=e&&T.leftButton&&(T.leftButton.style.display="none")}),setTimeout(function(){A.style.cssText=v,a.style.cssText=x},O)):(A.style.cssText=v,a.style.cssText=x,"in"!=e&&(A.style.display="none"))),P&&(r.removeClass(P,"highlighted"),w="display:block;opacity:"+("in"==e?"1":"0")+";"+(i===!0?"":S+"transition:opacity "+z+"ms;"),i!==!0?("in"==e&&(m="display:block;opacity:0;",P.style.cssText=m),o.listenTransition(P,k+O,function(){"in"!=e&&T.rightButton&&(T.rightButton.style.display="none")}),setTimeout(function(){P.style.cssText=w},O)):(P.style.cssText=w,"in"!=e&&(P.style.display="none"))),B&&(b="display:block;opacity:"+("in"==e?"1":"0")+";"+S+"transform:translate3d("+("in"==e?c:"left"==C?30:E)+"px,0px,0px);"+(i===!0?"":S+"transition:"+S+"transform "+k+"ms,opacity "+z+"ms;"),i!==!0?("in"==e&&(g="display:block;opacity:0;"+S+"transform:translate3d("+("left"==C?E-d/2:0)+"px,0px,0px);",B.style.cssText=g),o.listenTransition(B,k+O,function(){"in"!=e&&T.title&&(T.title.style.display="none"),s&&s.call(T)}),setTimeout(function(){B.style.cssText=b},O)):(B.style.cssText=b,"in"!=e&&(B.style.display="none"),s&&s.call(T)))},handleEvent:function(t){switch(t.type){case i.start:this.onButtonTouchStart(t);break;case i.end:this.onButtonTouchEnd(t);break;case"click":this.onButtonClick(t)}},doDestroy:function(){this.title&&(r.removeElement(this.title),this.title=null),this.destroyButton(!0),this.destroyButton(!1)},destroyButton:function(t){var e=t?"left":"right",n=this[e+"Button"];n&&(s.isSmartDevice&&(n.removeEventListener(i.start,this,!1),n.removeEventListener(i.end,this,!1)),n.removeEventListener("click",this,!1),r.removeElement(n),this[e+"Button"]=n=null)}})}(window);