X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..05ce1c11e98b33f14ddee184493bd5a60dc947e2:/docs/source/Element.scroll-more.html diff --git a/docs/source/Element.scroll-more.html b/docs/source/Element.scroll-more.html index d75a1113..4f91a4e9 100644 --- a/docs/source/Element.scroll-more.html +++ b/docs/source/Element.scroll-more.html @@ -1,11 +1,17 @@ - - - The source code - - - - -
/**
+
+
+  The source code
+    
+    
+
+
+    
/*!
+ * Ext JS Library 3.0.3
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+/**
  * @class Ext.Element
  */
 Ext.Element.addMethods({
@@ -17,15 +23,15 @@ Ext.Element.addMethods({
      * @return {Element} this
      */
     scrollTo : function(side, value, animate){
-        var tester = /top/i,
-        	prop = "scroll" + (tester.test(side) ? "Top" : "Left"),
-        	me = this,
-        	dom = me.dom;
+        var top = /top/i.test(side), //check if we're scrolling top or left
+            prop = 'scroll' + (top ? 'Left' : 'Top'), // if scrolling top, we need to grab scrollLeft, if left, scrollTop
+            me = this,
+            dom = me.dom;
         if (!animate || !me.anim) {
             dom[prop] = value;
         } else {
-            me.anim({scroll: {to: tester.test(prop) ? [dom[prop], value] : [value, dom[prop]]}},
-            		 me.preanim(arguments, 2), 'scroll');
+            me.anim({scroll: {to: top ? [dom[prop], value] : [value, dom[prop]]}},
+                     me.preanim(arguments, 2), 'scroll');
         }
         return me;
     },
@@ -108,6 +114,6 @@ Ext.Element.addMethods({
          }
          return scrolled;
     }
-});
- +});
+ \ No newline at end of file