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

Side by Side Diff: sky/examples/city-list/city-list.sky

Issue 758753003: Add auto-scroll option to sky city-list example (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: ws Created 6 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | sky/examples/city-list/index.sky » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Copyright 2014 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 --> 5 -->
6 <import src="../../framework/sky-element/sky-element.sky" as="SkyElement" /> 6 <import src="../../framework/sky-element/sky-element.sky" as="SkyElement" />
7 <import src="city-data-service.sky" as="CityDataService" /> 7 <import src="city-data-service.sky" as="CityDataService" />
8 <import src="city-sequence.sky" as="CitySequence" /> 8 <import src="city-sequence.sky" as="CitySequence" />
9 9
10 <template> 10 <template>
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 var scrollFrame = this.scroller.getCurrentFrame(); 592 var scrollFrame = this.scroller.getCurrentFrame();
593 this.tiler.updateFirstItem(indexOffset); 593 this.tiler.updateFirstItem(indexOffset);
594 this.updateView(data.items, false); 594 this.updateView(data.items, false);
595 }, 595 },
596 596
597 handleScroll: function(event) { 597 handleScroll: function(event) {
598 if (!this.scroller.captureNewFrame(event)) 598 if (!this.scroller.captureNewFrame(event))
599 return; 599 return;
600 600
601 this.updateView(this.loader.getItems(), true); 601 this.updateView(this.loader.getItems(), true);
602 },
603
604 scrollBy: function(amount) {
605 this.scrollerElement.scrollTop += amount;
606 this.handleScroll({ target: this.scrollerElement });
602 } 607 }
603 }); 608 });
604 609
605 })(this); 610 })(this);
606 611
607 </script> 612 </script>
608 613
OLDNEW
« no previous file with comments | « no previous file | sky/examples/city-list/index.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698