Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Build scrollview*

  • Loading branch information...
commit 825536c58c25de1d66117da0ed460b52ed8f1eab 1 parent 4cd88cb
@derek derek authored
View
2  build/scrollview-base/scrollview-base-debug.js
@@ -1211,4 +1211,4 @@ Y.ScrollView = Y.extend(ScrollView, Y.Widget, {
});
-}, '@VERSION@' ,{skinnable:true, requires:['widget', 'event-gestures', 'transition']});
+}, '@VERSION@' ,{requires:['widget', 'event-gestures', 'event-mousewheel', 'transition'], skinnable:true});
View
2  build/scrollview-base/scrollview-base-min.js
@@ -1,2 +1,2 @@
YUI.add("scrollview-base",function(d){var i=d.ClassNameManager.getClassName,x="scrollview",w={vertical:i(x,"vert"),horizontal:i(x,"horiz")},B="scrollEnd",l="flick",b=l,c="drag",a=true,k="ui",o="left",r="top",h="px",p="scrollY",q="scrollX",f="bounce",t="disabled",v="x",u="y",y="boundingBox",n="contentBox",A="",s="0s",j=d.UA.ie,e=d.Transition,g=e.useNative,m=function(E,D,C){return Math.min(Math.max(E,D),C);};function z(){z.superclass.constructor.apply(this,arguments);}d.ScrollView=d.extend(z,d.Widget,{initializer:function(){var C=this;C._cb=C.get(n);C._bb=C.get(y);},_uiSizeCB:function(){},_onTransEnd:function(C){this.fire(B);},bindUI:function(){var C=this;C._bindDrag(C.get(c));C._bindFlick(C.get(b));C._bindAttrs();if(j){C._fixIESelect(C._bb,C._cb);}},_bindAttrs:function(){var C=this,E=C._afterScrollChange,D=C._afterDimChange;this.after({"disabledChange":C._afterDisabledChange,"flickChange":C._afterFlickChange,"dragChange":C._afterDragChange,"scrollYChange":E,"scrollXChange":E,"heightChange":D,"widthChange":D});if(!j){this.after("renderedChange",function(F){});}},_bindDrag:function(C){var D=this._bb;if(C){D.on("drag|gesturemovestart",d.bind(this._onGestureMoveStart,this));}else{D.detach("drag|*");}},_bindFlick:function(D){var C=this._cb;if(D){C.on("flick|flick",d.bind(this._flick,this),D);}else{C.detach("flick|*");}},_bindMousewheel:function(D){var C=this._cb;if(this._scrollsVertical){if(D){C.on("mousewheel",d.bind(this._mousewheel,this),D);}else{C.detach("mousewheel|*");}}},syncUI:function(){this._cDisabled=this.get(t);this._uiDimensionsChange();this._bindMousewheel(a);this.scrollTo(this.get(q),this.get(p));},scrollTo:function(M,L,G,J){if(J===undefined){if(L<this._minScrollY){L=this._minScrollY;}else{if(L>this._maxScrollY){L=this._maxScrollY;}}}if(!this._cDisabled){var F=this._cb,H=(M!==null),E=(L!==null),D=(H)?M*-1:0,C=(E)?L*-1:0,I,K=z._TRANSITION,N=this._transEndCB;G=G||0;J=J||z.EASING;if(H){this.set(q,M,{src:k});}if(E){this.set(p,L,{src:k});}if(g){F.setStyle(K.DURATION,s).setStyle(K.PROPERTY,A);}if(G!==0){I={easing:J,duration:G/1000};if(g){I.transform=this._transform(D,C);}else{if(H){I.left=D+h;}if(E){I.top=C+h;}}if(!N){N=this._transEndCB=d.bind(this._onTransEnd,this);}F.transition(I,N);}else{if(g){F.setStyle("transform",this._transform(D,C));}else{if(H){F.setStyle(o,D+h);}if(E){F.setStyle(r,C+h);}}}}},_transform:function(C,D){return(this._forceHWTransforms)?"translate("+C+"px,"+D+"px) translateZ(0px)":"translate("+C+"px,"+D+"px)";},_moveTo:function(D,C,E){if(g){D.setStyle("transform",this._transform(C,E));}else{D.setStyle(o,C+h);D.setStyle(r,E+h);}},_forceHWTransforms:d.UA.webkit?true:false,_prevent:{start:false,move:true,end:false},_onGestureMoveStart:function(D){var C=this,E=C._bb;if(!C._cDisabled){if(C._prevent.start){D.preventDefault();}C._killTimer();C._hm=E.on("drag|gesturemove",d.bind(C._onGestureMove,C));C._hme=E.on("drag|gesturemoveend",d.bind(C._onGestureMoveEnd,C));C._startY=D.clientY+C.get(p);C._startX=D.clientX+C.get(q);C._startClientY=C._endClientY=D.clientY;C._startClientX=C._endClientX=D.clientX;C._isDragging=false;C._flicking=false;C._snapToEdge=false;}},_onGestureMove:function(D){var C=this;if(C._prevent.move){D.preventDefault();}C._isDragging=true;C._endClientY=D.clientY;C._endClientX=D.clientX;if(C._scrollsVertical){C.set(p,-(D.clientY-C._startY));}if(C._scrollsHorizontal){C.set(q,-(D.clientX-C._startX));}},_onGestureMoveEnd:function(K){if(this._prevent.end){K.preventDefault();}var R=this,G=R._minScrollY,C=R._maxScrollY,H=R._minScrollX,E=R._maxScrollX,J=R._scrollsVertical,S=R._scrollsHorizontal,F=J?R._startClientY:R._startClientX,P=J?R._endClientY:R._endClientX,D=F-P,I=Math.abs(D),M=R._bb,Q,O,N,L;R._hm.detach();R._hme.detach();R._scrolledHalfway=R._snapToEdge=R._isDragging=false;R.lastScrolledAmt=D;if((S&&I>M.get("offsetWidth")/2)||(J&&I>M.get("offsetHeight")/2)){R._scrolledHalfway=true;R._scrolledForward=D>0;}if(J){L=R.get(p);O=m(L,G,C);}if(S){N=R.get(q);Q=m(N,H,E);}if(Q!==N||O!==L){this._snapToEdge=true;if(J){R.set(p,O);}if(S){R.set(q,Q);}}if(R._snapToEdge){return;}R.fire(B,{onGestureMoveEnd:true});return;},_afterScrollChange:function(D){var C=D.duration,F=D.easing,E=D.newVal;if(D.src!==k){if(D.attrName==q){this._uiScrollTo(E,null,C,F);}else{this._uiScrollTo(null,E,C,F);}}},_afterFlickChange:function(C){this._bindFlick(C.newVal);},_afterDisabledChange:function(C){this._cDisabled=C.newVal;},_afterDragChange:function(C){this._bindDrag(C.newVal);},_uiScrollTo:function(C,F,D,E){D=D||this._snapToEdge?400:0;E=E||this._snapToEdge?z.SNAP_EASING:null;this.scrollTo(C,F,D,E);},_afterDimChange:function(){this._uiDimensionsChange();},_getScrollDims:function(){var H,I=this.get(q),G=this.get(p),C=this.get(n),F=this.get(y),E,D=z._TRANSITION;if(g){C.setStyle(D.DURATION,s);C.setStyle(D.PROPERTY,A);}E=this._forceHWTransforms;this._forceHWTransforms=false;this._moveTo(C,0,0);H=[F.get("offsetWidth"),F.get("offsetHeight"),F.get("scrollWidth"),F.get("scrollHeight")];this._moveTo(C,-1*I,-1*G);this._forceHWTransforms=E;return H;},_uiDimensionsChange:function(){var D=this,I=D._bb,H=z.CLASS_NAMES,J=this._getScrollDims(),G=J[0],C=J[1],E=J[2],F=J[3];if(C&&F>C){D._scrollsVertical=true;D._maxScrollY=F-C;D._minScrollY=0;D._scrollHeight=F;D._height=C;I.addClass(H.vertical);}else{D._scrollsVertical=false;delete D._maxScrollY;delete D._minScrollY;delete D._scrollHeight;delete D._height;I.removeClass(H.vertical);}if(G&&E>G){D._scrollsHorizontal=true;D._maxScrollX=E-G;D._minScrollX=0;D._scrollWidth=E;D._width=G;I.addClass(H.horizontal);}else{D._scrollsHorizontal=false;delete D._maxScrollX;delete D._minScrollX;delete D._scrollWidth;delete D._width;I.removeClass(H.horizontal);}},_flick:function(E){var D=E.flick,C=this;if(!C._cDisabled){C._currentVelocity=D.velocity;C._flicking=true;C._cDecel=C.get("deceleration");C._cBounce=C.get("bounce");C._pastYEdge=false;C._pastXEdge=false;C._flickFrame();C.fire(l);}},_mousewheel:function(F){var E=this.get("scrollY"),C=this._cb,D=10,G=E-(F.wheelDelta*D);this.scrollTo(0,G);
-if(this.scrollbars){this.scrollbars._update();this.scrollbars.flash();}F.preventDefault();},_flickFrame:function(){var L=this,O,D,G,C,E,H,M=L._scrollsVertical,J=L._scrollsHorizontal,I=L._cDecel,N=L._cBounce,K=L._currentVelocity,F=z.FRAME_STEP;if(M){D=L._maxScrollY;G=L._minScrollY;O=L.get(p)-(K*F);}if(J){E=L._maxScrollX;H=L._minScrollX;C=L.get(q)-(K*F);}K=L._currentVelocity=(K*I);if(Math.abs(K).toFixed(4)<=0.015){L._flicking=false;L._killTimer(!(L._pastYEdge||L._pastXEdge));if(M){if(O<G){L._snapToEdge=true;L.set(p,G);}else{if(O>D){L._snapToEdge=true;L.set(p,D);}}}if(J){if(C<H){L._snapToEdge=true;L.set(q,H);}else{if(C>E){L._snapToEdge=true;L.set(q,E);}}}return;}if(M){if(O<G||O>D){L._pastYEdge=true;L._currentVelocity*=N;}L.set(p,O);}if(J){if(C<H||C>E){L._pastXEdge=true;L._currentVelocity*=N;}L.set(q,C);}if(!L._flickTimer){L._flickTimer=d.later(F,L,"_flickFrame",null,true);}},_killTimer:function(D){var C=this;if(C._flickTimer){C._flickTimer.cancel();C._flickTimer=null;}if(D){C.fire(B);}},_setScroll:function(I,H){if(this._cDisabled){I=d.Attribute.INVALID_VALUE;}else{var E=this._cachedBounce||this.get(f),D=z.BOUNCE_RANGE,G=(H==v)?this._maxScrollX:this._maxScrollY,F=E?-D:0,C=E?G+D:G;if(!E||!this._isDragging){if(I<F){I=F;}else{if(I>C){I=C;}}}}return I;},_setScrollX:function(C){return this._setScroll(C,v);},_setScrollY:function(C){return this._setScroll(C,u);}},{NAME:"scrollview",ATTRS:{scrollY:{value:0,setter:"_setScrollY"},scrollX:{value:0,setter:"_setScrollX"},deceleration:{value:0.93},bounce:{value:0.1},flick:{value:{minDistance:10,minVelocity:0.3}},drag:{value:true}},CLASS_NAMES:w,UI_SRC:k,BOUNCE_RANGE:150,FRAME_STEP:30,EASING:"cubic-bezier(0, 0.1, 0, 1.0)",SNAP_EASING:"ease-out",_TRANSITION:{DURATION:e._VENDOR_PREFIX+"TransitionDuration",PROPERTY:e._VENDOR_PREFIX+"TransitionProperty"}});},"@VERSION@",{skinnable:true,requires:["widget","event-gestures","transition"]});
+if(this.scrollbars){this.scrollbars._update();this.scrollbars.flash();}F.preventDefault();},_flickFrame:function(){var L=this,O,D,G,C,E,H,M=L._scrollsVertical,J=L._scrollsHorizontal,I=L._cDecel,N=L._cBounce,K=L._currentVelocity,F=z.FRAME_STEP;if(M){D=L._maxScrollY;G=L._minScrollY;O=L.get(p)-(K*F);}if(J){E=L._maxScrollX;H=L._minScrollX;C=L.get(q)-(K*F);}K=L._currentVelocity=(K*I);if(Math.abs(K).toFixed(4)<=0.015){L._flicking=false;L._killTimer(!(L._pastYEdge||L._pastXEdge));if(M){if(O<G){L._snapToEdge=true;L.set(p,G);}else{if(O>D){L._snapToEdge=true;L.set(p,D);}}}if(J){if(C<H){L._snapToEdge=true;L.set(q,H);}else{if(C>E){L._snapToEdge=true;L.set(q,E);}}}return;}if(M){if(O<G||O>D){L._pastYEdge=true;L._currentVelocity*=N;}L.set(p,O);}if(J){if(C<H||C>E){L._pastXEdge=true;L._currentVelocity*=N;}L.set(q,C);}if(!L._flickTimer){L._flickTimer=d.later(F,L,"_flickFrame",null,true);}},_killTimer:function(D){var C=this;if(C._flickTimer){C._flickTimer.cancel();C._flickTimer=null;}if(D){C.fire(B);}},_setScroll:function(I,H){if(this._cDisabled){I=d.Attribute.INVALID_VALUE;}else{var E=this._cachedBounce||this.get(f),D=z.BOUNCE_RANGE,G=(H==v)?this._maxScrollX:this._maxScrollY,F=E?-D:0,C=E?G+D:G;if(!E||!this._isDragging){if(I<F){I=F;}else{if(I>C){I=C;}}}}return I;},_setScrollX:function(C){return this._setScroll(C,v);},_setScrollY:function(C){return this._setScroll(C,u);}},{NAME:"scrollview",ATTRS:{scrollY:{value:0,setter:"_setScrollY"},scrollX:{value:0,setter:"_setScrollX"},deceleration:{value:0.93},bounce:{value:0.1},flick:{value:{minDistance:10,minVelocity:0.3}},drag:{value:true}},CLASS_NAMES:w,UI_SRC:k,BOUNCE_RANGE:150,FRAME_STEP:30,EASING:"cubic-bezier(0, 0.1, 0, 1.0)",SNAP_EASING:"ease-out",_TRANSITION:{DURATION:e._VENDOR_PREFIX+"TransitionDuration",PROPERTY:e._VENDOR_PREFIX+"TransitionProperty"}});},"@VERSION@",{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:true});
View
2  build/scrollview-base/scrollview-base.js
@@ -1209,4 +1209,4 @@ Y.ScrollView = Y.extend(ScrollView, Y.Widget, {
});
-}, '@VERSION@' ,{skinnable:true, requires:['widget', 'event-gestures', 'transition']});
+}, '@VERSION@' ,{requires:['widget', 'event-gestures', 'event-mousewheel', 'transition'], skinnable:true});
View
2  build/scrollview-list/scrollview-list-debug.js
@@ -127,4 +127,4 @@ Y.namespace("Plugin").ScrollViewList = Y.extend(ListPlugin, Y.Plugin.Base, {
-}, '@VERSION@' ,{skinnable:true, requires:['plugin', 'classnamemanager']});
+}, '@VERSION@' ,{requires:['plugin', 'classnamemanager'], skinnable:true});
View
2  build/scrollview-list/scrollview-list-min.js
@@ -1 +1 @@
-YUI.add("scrollview-list",function(a){var b=a.ClassNameManager.getClassName,d="scrollview",c=b(d,"list"),g=b(d,"item"),h="contentBox",e="rendered",i="renderUI",j="host";function f(){f.superclass.constructor.apply(this,arguments);}f.NAME="pluginList";f.NS="list";f.ATTRS={isAttached:{value:false,validator:a.Lang.isBoolean}};a.namespace("Plugin").ScrollViewList=a.extend(f,a.Plugin.Base,{initializer:function(){this._host=this.get(j);this.afterHostEvent("render",this._addClassesToList);},_addClassesToList:function(){if(!this.get("isAttached")){var l=this._host.get(h),m,k;if(l.hasChildNodes()){m=l.all("> ul");k=l.all("> ul > li");m.each(function(n){n.addClass(c);});k.each(function(n){n.addClass(g);});this.set("isAttached",true);this._host.syncUI();}}}});},"@VERSION@",{skinnable:true,requires:["plugin","classnamemanager"]});
+YUI.add("scrollview-list",function(a){var b=a.ClassNameManager.getClassName,d="scrollview",c=b(d,"list"),g=b(d,"item"),h="contentBox",e="rendered",i="renderUI",j="host";function f(){f.superclass.constructor.apply(this,arguments);}f.NAME="pluginList";f.NS="list";f.ATTRS={isAttached:{value:false,validator:a.Lang.isBoolean}};a.namespace("Plugin").ScrollViewList=a.extend(f,a.Plugin.Base,{initializer:function(){this._host=this.get(j);this.afterHostEvent("render",this._addClassesToList);},_addClassesToList:function(){if(!this.get("isAttached")){var l=this._host.get(h),m,k;if(l.hasChildNodes()){m=l.all("> ul");k=l.all("> ul > li");m.each(function(n){n.addClass(c);});k.each(function(n){n.addClass(g);});this.set("isAttached",true);this._host.syncUI();}}}});},"@VERSION@",{requires:["plugin","classnamemanager"],skinnable:true});
View
2  build/scrollview-list/scrollview-list.js
@@ -127,4 +127,4 @@ Y.namespace("Plugin").ScrollViewList = Y.extend(ListPlugin, Y.Plugin.Base, {
-}, '@VERSION@' ,{skinnable:true, requires:['plugin', 'classnamemanager']});
+}, '@VERSION@' ,{requires:['plugin', 'classnamemanager'], skinnable:true});
View
2  build/scrollview-scrollbars/scrollview-scrollbars-debug.js
@@ -550,4 +550,4 @@ Y.namespace("Plugin").ScrollViewScrollbars = Y.extend(ScrollbarsPlugin, Y.Plugin
});
-}, '@VERSION@' ,{skinnable:true, requires:['classnamemanager', 'transition', 'plugin']});
+}, '@VERSION@' ,{requires:['classnamemanager', 'transition', 'plugin'], skinnable:true});
View
2  build/scrollview-scrollbars/scrollview-scrollbars-min.js
@@ -1 +1 @@
-YUI.add("scrollview-scrollbars",function(a){var m=a.ClassNameManager.getClassName,j,h=a.Transition,k=h.useNative,A="scrollbar",D="scrollview",C="verticalNode",n="horizontalNode",v="childCache",x="top",r="left",g="width",w="height",q="scrollWidth",i="scrollHeight",B="_sbh",u="_sbv",o=h._VENDOR_PREFIX+"TransitionProperty",f="transform",e="translateX(",d="translateY(",z="scaleX(",y="scaleY(",t="scrollX",s="scrollY",l="px",c=")",p=l+c;function b(){b.superclass.constructor.apply(this,arguments);}b.CLASS_NAMES={showing:m(D,A,"showing"),scrollbar:m(D,A),scrollbarV:m(D,A,"vert"),scrollbarH:m(D,A,"horiz"),scrollbarVB:m(D,A,"vert","basic"),scrollbarHB:m(D,A,"horiz","basic"),child:m(D,"child"),first:m(D,"first"),middle:m(D,"middle"),last:m(D,"last")};j=b.CLASS_NAMES;b.NAME="pluginScrollViewScrollbars";b.NS="scrollbars";b.SCROLLBAR_TEMPLATE=["<div>",'<span class="'+j.child+" "+j.first+'"></span>','<span class="'+j.child+" "+j.middle+'"></span>','<span class="'+j.child+" "+j.last+'"></span>',"</div>"].join("");b.ATTRS={verticalNode:{setter:"_setNode",valueFn:"_defaultNode"},horizontalNode:{setter:"_setNode",valueFn:"_defaultNode"}};a.namespace("Plugin").ScrollViewScrollbars=a.extend(b,a.Plugin.Base,{initializer:function(){this._host=this.get("host");this.afterHostEvent("scrollEnd",this._hostScrollEnd);this.afterHostMethod("_uiScrollTo",this._update);this.afterHostMethod("_uiDimensionsChange",this._hostDimensionsChange);},_hostDimensionsChange:function(){var E=this._host;this._renderBar(this.get(C),E._scrollsVertical);this._renderBar(this.get(n),E._scrollsHorizontal);this._update();a.later(500,this,"flash",true);},_hostScrollEnd:function(E){if(!this._host._flicking){this.flash();}},_renderBar:function(F,H){var G=F.inDoc(),I=this._host._bb,E=F.getData("isHoriz")?j.scrollbarHB:j.scrollbarVB;if(H&&!G){I.append(F);F.toggleClass(E,this._basic);this._setChildCache(F);}else{if(!H&&G){F.remove();this._clearChildCache(F);}}},_setChildCache:function(H){var J=H.get("children"),F=J.item(0),I=J.item(1),G=J.item(2),E=H.getData("isHoriz")?"offsetWidth":"offsetHeight";H.setStyle(o,f);I.setStyle(o,f);G.setStyle(o,f);H.setData(v,{fc:F,lc:G,mc:I,fcSize:F&&F.get(E),lcSize:G&&G.get(E)});},_clearChildCache:function(E){E.clearData(v);},_updateBar:function(E,N,G,X){var L=this._host,H=this._basic,M=L._cb,S=0,O=1,F=E.getData(v),T=F.lc,W=F.mc,ab=F.fcSize,aa=F.lcSize,P,Y,V,K,Z,R,I,U,Q,J;if(X){R=g;I=r;U=B;Q=L._width;J=L._scrollWidth;K=e;Z=z;N=(N!==undefined)?N:L.get(t);}else{R=w;I=x;U=u;Q=L._height;J=L._scrollHeight;K=d;Z=y;N=(N!==undefined)?N:L.get(s);}S=Math.floor(Q*(Q/J));O=Math.floor((N/(J-Q))*(Q-S));if(S>Q){S=1;}if(O>(Q-S)){S=S-(O-(Q-S));}else{if(O<0){S=O+S;O=0;}}P=(S-(ab+aa));if(P<0){P=0;}if(P===0&&O!==0){O=Q-(ab+aa)-1;}if(G!==0){V={duration:G};if(k){V.transform=K+O+p;}else{V[I]=O+l;}E.transition(V);}else{if(k){E.setStyle(f,K+O+p);}else{E.setStyle(I,O+l);}}if(this[U]!==P){this[U]=P;if(P>0){if(G!==0){V={duration:G};if(k){V.transform=Z+P+c;}else{V[R]=P+l;}W.transition(V);}else{if(k){W.setStyle(f,Z+P+c);}else{W.setStyle(R,P+l);}}if(!X||!H){Y=S-aa;if(G!==0){V={duration:G};if(k){V.transform=K+Y+p;}else{V[I]=Y;}T.transition(V);}else{if(k){T.setStyle(f,K+Y+p);}else{T.setStyle(I,Y+l);}}}}}},_update:function(F,K,I,J){var H=this.get(C),E=this.get(n),G=this._host;I=(I||0)/1000;if(!this._showing){this.show();}if(G._scrollsVertical&&H){this._updateBar(H,K,I,false);}if(G._scrollsHorizontal&&E){this._updateBar(E,F,I,true);}},show:function(E){this._show(true,E);},hide:function(E){this._show(false,E);},_show:function(E,H){var G=this.get(C),I=this.get(n),J=(H)?0.6:0,F=(E)?1:0,K;this._showing=E;if(this._flashTimer){this._flashTimer.cancel();}K={duration:J,opacity:F};if(G){G.transition(K);}if(I){I.transition(K);}},flash:function(){var E=this._host;this.show(true);this._flashTimer=a.later(800,this,"hide",true);},_setNode:function(F,E){var G=(E==n);F=a.one(F);if(F){F.addClass(j.scrollbar);F.addClass((G)?j.scrollbarH:j.scrollbarV);F.setData("isHoriz",G);}return F;},_defaultNode:function(){return a.Node.create(b.SCROLLBAR_TEMPLATE);},_basic:a.UA.ie&&a.UA.ie<=8});},"@VERSION@",{skinnable:true,requires:["classnamemanager","transition","plugin"]});
+YUI.add("scrollview-scrollbars",function(a){var m=a.ClassNameManager.getClassName,j,h=a.Transition,k=h.useNative,A="scrollbar",D="scrollview",C="verticalNode",n="horizontalNode",v="childCache",x="top",r="left",g="width",w="height",q="scrollWidth",i="scrollHeight",B="_sbh",u="_sbv",o=h._VENDOR_PREFIX+"TransitionProperty",f="transform",e="translateX(",d="translateY(",z="scaleX(",y="scaleY(",t="scrollX",s="scrollY",l="px",c=")",p=l+c;function b(){b.superclass.constructor.apply(this,arguments);}b.CLASS_NAMES={showing:m(D,A,"showing"),scrollbar:m(D,A),scrollbarV:m(D,A,"vert"),scrollbarH:m(D,A,"horiz"),scrollbarVB:m(D,A,"vert","basic"),scrollbarHB:m(D,A,"horiz","basic"),child:m(D,"child"),first:m(D,"first"),middle:m(D,"middle"),last:m(D,"last")};j=b.CLASS_NAMES;b.NAME="pluginScrollViewScrollbars";b.NS="scrollbars";b.SCROLLBAR_TEMPLATE=["<div>",'<span class="'+j.child+" "+j.first+'"></span>','<span class="'+j.child+" "+j.middle+'"></span>','<span class="'+j.child+" "+j.last+'"></span>',"</div>"].join("");b.ATTRS={verticalNode:{setter:"_setNode",valueFn:"_defaultNode"},horizontalNode:{setter:"_setNode",valueFn:"_defaultNode"}};a.namespace("Plugin").ScrollViewScrollbars=a.extend(b,a.Plugin.Base,{initializer:function(){this._host=this.get("host");this.afterHostEvent("scrollEnd",this._hostScrollEnd);this.afterHostMethod("_uiScrollTo",this._update);this.afterHostMethod("_uiDimensionsChange",this._hostDimensionsChange);},_hostDimensionsChange:function(){var E=this._host;this._renderBar(this.get(C),E._scrollsVertical);this._renderBar(this.get(n),E._scrollsHorizontal);this._update();a.later(500,this,"flash",true);},_hostScrollEnd:function(E){if(!this._host._flicking){this.flash();}},_renderBar:function(F,H){var G=F.inDoc(),I=this._host._bb,E=F.getData("isHoriz")?j.scrollbarHB:j.scrollbarVB;if(H&&!G){I.append(F);F.toggleClass(E,this._basic);this._setChildCache(F);}else{if(!H&&G){F.remove();this._clearChildCache(F);}}},_setChildCache:function(H){var J=H.get("children"),F=J.item(0),I=J.item(1),G=J.item(2),E=H.getData("isHoriz")?"offsetWidth":"offsetHeight";H.setStyle(o,f);I.setStyle(o,f);G.setStyle(o,f);H.setData(v,{fc:F,lc:G,mc:I,fcSize:F&&F.get(E),lcSize:G&&G.get(E)});},_clearChildCache:function(E){E.clearData(v);},_updateBar:function(E,N,G,X){var L=this._host,H=this._basic,M=L._cb,S=0,O=1,F=E.getData(v),T=F.lc,W=F.mc,ab=F.fcSize,aa=F.lcSize,P,Y,V,K,Z,R,I,U,Q,J;if(X){R=g;I=r;U=B;Q=L._width;J=L._scrollWidth;K=e;Z=z;N=(N!==undefined)?N:L.get(t);}else{R=w;I=x;U=u;Q=L._height;J=L._scrollHeight;K=d;Z=y;N=(N!==undefined)?N:L.get(s);}S=Math.floor(Q*(Q/J));O=Math.floor((N/(J-Q))*(Q-S));if(S>Q){S=1;}if(O>(Q-S)){S=S-(O-(Q-S));}else{if(O<0){S=O+S;O=0;}}P=(S-(ab+aa));if(P<0){P=0;}if(P===0&&O!==0){O=Q-(ab+aa)-1;}if(G!==0){V={duration:G};if(k){V.transform=K+O+p;}else{V[I]=O+l;}E.transition(V);}else{if(k){E.setStyle(f,K+O+p);}else{E.setStyle(I,O+l);}}if(this[U]!==P){this[U]=P;if(P>0){if(G!==0){V={duration:G};if(k){V.transform=Z+P+c;}else{V[R]=P+l;}W.transition(V);}else{if(k){W.setStyle(f,Z+P+c);}else{W.setStyle(R,P+l);}}if(!X||!H){Y=S-aa;if(G!==0){V={duration:G};if(k){V.transform=K+Y+p;}else{V[I]=Y;}T.transition(V);}else{if(k){T.setStyle(f,K+Y+p);}else{T.setStyle(I,Y+l);}}}}}},_update:function(F,K,I,J){var H=this.get(C),E=this.get(n),G=this._host;I=(I||0)/1000;if(!this._showing){this.show();}if(G._scrollsVertical&&H){this._updateBar(H,K,I,false);}if(G._scrollsHorizontal&&E){this._updateBar(E,F,I,true);}},show:function(E){this._show(true,E);},hide:function(E){this._show(false,E);},_show:function(E,H){var G=this.get(C),I=this.get(n),J=(H)?0.6:0,F=(E)?1:0,K;this._showing=E;if(this._flashTimer){this._flashTimer.cancel();}K={duration:J,opacity:F};if(G){G.transition(K);}if(I){I.transition(K);}},flash:function(){var E=this._host;this.show(true);this._flashTimer=a.later(800,this,"hide",true);},_setNode:function(F,E){var G=(E==n);F=a.one(F);if(F){F.addClass(j.scrollbar);F.addClass((G)?j.scrollbarH:j.scrollbarV);F.setData("isHoriz",G);}return F;},_defaultNode:function(){return a.Node.create(b.SCROLLBAR_TEMPLATE);},_basic:a.UA.ie&&a.UA.ie<=8});},"@VERSION@",{requires:["classnamemanager","transition","plugin"],skinnable:true});
View
2  build/scrollview-scrollbars/scrollview-scrollbars.js
@@ -550,4 +550,4 @@ Y.namespace("Plugin").ScrollViewScrollbars = Y.extend(ScrollbarsPlugin, Y.Plugin
});
-}, '@VERSION@' ,{skinnable:true, requires:['classnamemanager', 'transition', 'plugin']});
+}, '@VERSION@' ,{requires:['classnamemanager', 'transition', 'plugin'], skinnable:true});

0 comments on commit 825536c

Please sign in to comment.
Something went wrong with that request. Please try again.