X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..10a866c12701c0a0afd0ac85dcdcf32a421514ac:/docs/source/Element.scroll-more.html
diff --git a/docs/source/Element.scroll-more.html b/docs/source/Element.scroll-more.html
index d75a1113..0d54fd66 100644
--- a/docs/source/Element.scroll-more.html
+++ b/docs/source/Element.scroll-more.html
@@ -1,5 +1,6 @@
+
The source code
@@ -17,14 +18,16 @@ Ext.Element.addMethods({
* @return {Element} this
*/
scrollTo : function(side, value, animate){
- var tester = /top/i,
- prop = "scroll" + (tester.test(side) ? "Top" : "Left"),
+ var top = /top/i.test(side), //check if we're scrolling top or left
me = this,
- dom = me.dom;
+ dom = me.dom,
+ prop;
if (!animate || !me.anim) {
+ prop = 'scroll' + (top ? 'Top' : 'Left'), // just setting the value, so grab the direction
dom[prop] = value;
- } else {
- me.anim({scroll: {to: tester.test(prop) ? [dom[prop], value] : [value, dom[prop]]}},
+ }else{
+ prop = 'scroll' + (top ? 'Left' : 'Top'), // if scrolling top, we need to grab scrollLeft, if left, scrollTop
+ me.anim({scroll: {to: top ? [dom[prop], value] : [value, dom[prop]]}},
me.preanim(arguments, 2), 'scroll');
}
return me;