Fix bug in city-list autoscroll
TBR=esprehn Review URL: https://codereview.chromium.org/759483003
This commit is contained in:
parent
a0df465d10
commit
034e19300d
@ -31,7 +31,7 @@ window.startLoad = new Date().getTime();
|
|||||||
<city-list></city-list>
|
<city-list></city-list>
|
||||||
<script>
|
<script>
|
||||||
var cityList = document.querySelector('city-list');
|
var cityList = document.querySelector('city-list');
|
||||||
var scrollBy = location.search.match(/auto=([0-9]+)/)[1];
|
var scrollBy = Number(location.search.match(/auto=([0-9]+)/)[1]);
|
||||||
|
|
||||||
function autoScroll() {
|
function autoScroll() {
|
||||||
cityList.scrollBy(scrollBy);
|
cityList.scrollBy(scrollBy);
|
||||||
@ -39,7 +39,6 @@ window.startLoad = new Date().getTime();
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (scrollBy) {
|
if (scrollBy) {
|
||||||
console.log('Autoscroll by ' + scrollBy);
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
requestAnimationFrame(autoScroll);
|
requestAnimationFrame(autoScroll);
|
||||||
}, 200)
|
}, 200)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user