1229 | | // Though the computed offset value maybe out of range ( e.g. |
1230 | | // a negative value ), browser will try to scroll as much as possible. (#3692) |
1231 | | win.$.scrollTo( 0, offset > 0 ? offset : 0 ); |
| 1227 | // offset value might be out of range(nagative), fix it(#3692). |
| 1228 | offset = offset < 0 ? 0 : offset; |
| 1229 | |
| 1230 | // Scroll the window to the desired position, if not already visible(#3795). |
| 1231 | var currentScroll = win.getScrollPosition().y; |
| 1232 | if ( offset > currentScroll || offset < currentScroll - winHeight ) |
| 1233 | win.$.scrollTo( 0, offset ); |