Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / src / core / Element.scroll-more.js
index ef5fd72..535eafd 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * Ext JS Library 3.0.3
+ * Ext JS Library 3.1.0
  * Copyright(c) 2006-2009 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
@@ -17,14 +17,16 @@ Ext.Element.addMethods({
      */\r
     scrollTo : function(side, value, animate){\r
         var top = /top/i.test(side), //check if we're scrolling top or left\r
-            prop = 'scroll' + (top ? 'Left' : 'Top'), // if scrolling top, we need to grab scrollLeft, if left, scrollTop\r
-            me = this,\r
-            dom = me.dom;\r
+               me = this,\r
+               dom = me.dom,\r
+            prop;\r
         if (!animate || !me.anim) {\r
+            prop = 'scroll' + (top ? 'Top' : 'Left'), // just setting the value, so grab the direction\r
             dom[prop] = value;\r
-        } else {\r
+        }else{\r
+            prop = 'scroll' + (top ? 'Left' : 'Top'), // if scrolling top, we need to grab scrollLeft, if left, scrollTop\r
             me.anim({scroll: {to: top ? [dom[prop], value] : [value, dom[prop]]}},\r
-                     me.preanim(arguments, 2), 'scroll');\r
+                        me.preanim(arguments, 2), 'scroll');\r
         }\r
         return me;\r
     },\r