Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(487)

Unified Diff: sky/examples/city-list/index.sky

Issue 760403002: fix the fix to city-list example autoscroll (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/city-list/index.sky
diff --git a/sky/examples/city-list/index.sky b/sky/examples/city-list/index.sky
index 41de93817ca58a605754235ead7abf1c2519f1e1..47f52085d4af0eae079feeff1a918895b061c3af 100644
--- a/sky/examples/city-list/index.sky
+++ b/sky/examples/city-list/index.sky
@@ -31,7 +31,11 @@ window.startLoad = new Date().getTime();
<city-list></city-list>
<script>
var cityList = document.querySelector('city-list');
- var scrollBy = Number(location.search.match(/auto=([0-9]+)/)[1]);
+ var scrollBy = 0;
+ var toks = location.search.match(/auto=([0-9]+)/);
+ if (toks) {
+ scrollBy = Number(toks[1]);
+ }
function autoScroll() {
cityList.scrollBy(scrollBy);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698