X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..6e39d509471fe9b4e2660e0d1631b350d0c66f40:/src/core/Element.scroll-more.js diff --git a/src/core/Element.scroll-more.js b/src/core/Element.scroll-more.js index ef5fd72b..535eafd9 100644 --- a/src/core/Element.scroll-more.js +++ b/src/core/Element.scroll-more.js @@ -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({ */ scrollTo : function(side, value, animate){ 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; + me = this, + 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 { + }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'); + me.preanim(arguments, 2), 'scroll'); } return me; },