Ticket #3692: 3692_2.patch
File 3692_2.patch, 895 bytes (added by , 14 years ago) |
---|
-
_source/core/dom/element.js
1197 1197 // Append the offsets for the entire element hierarchy. 1198 1198 var elementPosition = this.getDocumentPosition(); 1199 1199 offset += elementPosition.y; 1200 1201 1200 // Scroll the window to the desired position, if not already visible. 1202 1201 var currentScroll = win.getScrollPosition().y; 1203 if ( offset > 0 && ( offset > currentScroll || offset < currentScroll - winHeight ) ) 1204 win.$.scrollTo( 0, offset ); 1202 1203 // Though the computed offset value maybe out of range ( e.g. 1204 // a negative value ), browser will try to scroll as much as possible. (#3692) 1205 win.$.scrollTo( 0, offset > 0 ? offset : 0 ); 1205 1206 }, 1206 1207 1207 1208 setState : function( state )