-<html>\r
-<head>\r
- <title>The source code</title>\r
- <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
- <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
-</head>\r
-<body onload="prettyPrint();">\r
- <pre class="prettyprint lang-js">/**\r
+<html>
+<head>
+ <title>The source code</title>
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
+</head>
+<body onload="prettyPrint();">
+ <pre class="prettyprint lang-js">/*!
+ * Ext JS Library 3.0.3
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+/**\r
* @class Ext.Element\r
*/\r
Ext.Element.addMethods({\r
* @return {Element} this\r
*/\r
scrollTo : function(side, value, animate){\r
- var tester = /top/i,\r
- prop = "scroll" + (tester.test(side) ? "Top" : "Left"),\r
- me = this,\r
- dom = me.dom;\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
if (!animate || !me.anim) {\r
dom[prop] = value;\r
} else {\r
- me.anim({scroll: {to: tester.test(prop) ? [dom[prop], value] : [value, dom[prop]]}},\r
- me.preanim(arguments, 2), 'scroll');\r
+ me.anim({scroll: {to: top ? [dom[prop], value] : [value, dom[prop]]}},\r
+ me.preanim(arguments, 2), 'scroll');\r
}\r
return me;\r
},\r
}\r
return scrolled;\r
}\r
-});</pre> \r
-</body>\r
+});</pre>
+</body>
</html>
\ No newline at end of file