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

Side by Side Diff: sky/examples/stocks/stocks.sky

Issue 980953002: stocks and stocks-fn should share the stocks data (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months 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 | « sky/examples/stocks/companylist.sky ('k') | no next file » | 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 2015 The Chromium Authors. All rights reserved. 2 // Copyright 2015 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="/sky/framework/sky-drawer-header.sky" /> 6 <import src="/sky/framework/sky-drawer-header.sky" />
7 <import src="/sky/framework/sky-drawer.sky" /> 7 <import src="/sky/framework/sky-drawer.sky" />
8 <import src="/sky/framework/sky-element.sky" /> 8 <import src="/sky/framework/sky-element.sky" />
9 <import src="/sky/framework/sky-icon.sky" /> 9 <import src="/sky/framework/sky-icon.sky" />
10 <import src="/sky/framework/sky-menu-divider.sky" /> 10 <import src="/sky/framework/sky-menu-divider.sky" />
11 <import src="/sky/framework/sky-menu-item.sky" /> 11 <import src="/sky/framework/sky-menu-item.sky" />
12 <import src="/sky/framework/sky-scrollable.sky" /> 12 <import src="/sky/framework/sky-scrollable.sky" />
13 <import src="/sky/framework/sky-toolbar.sky" /> 13 <import src="/sky/framework/sky-toolbar.sky" />
14 <import src="stock.sky" as='view'/> 14 <import src="stock.sky" as='view'/>
15 <import src='companylist.sky' as='model'/>
16 15
17 <sky-element> 16 <sky-element>
18 <template> 17 <template>
19 <style> 18 <style>
20 :host { 19 :host {
21 display: flex; 20 display: flex;
22 flex-direction: column; 21 flex-direction: column;
23 height: -webkit-fill-available; 22 height: -webkit-fill-available;
24 font-family: 'Roboto Regular', 'Helvetica'; 23 font-family: 'Roboto Regular', 'Helvetica';
25 font-size: 16px; 24 font-size: 16px;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 <div id="title">I am a stocks app</div> 63 <div id="title">I am a stocks app</div>
65 <sky-icon type="action/search_white" size="24" /> 64 <sky-icon type="action/search_white" size="24" />
66 <sky-icon type="navigation/more_vert_white" size="24" /> 65 <sky-icon type="navigation/more_vert_white" size="24" />
67 </sky-toolbar> 66 </sky-toolbar>
68 <sky-scrollable id='stock_list'> 67 <sky-scrollable id='stock_list'>
69 </sky-scrollable> 68 </sky-scrollable>
70 </template> 69 </template>
71 <script> 70 <script>
72 import "dart:sky"; 71 import "dart:sky";
73 import "dart:math"; 72 import "dart:math";
73 import "../data/stocks.dart" as model;
74 74
75 List pick(List list, int count) { 75 List pick(List list, int count) {
76 var rng = new Random(); 76 var rng = new Random();
77 List picked = new List(); 77 List picked = new List();
78 for (int i = 0; i < count; i++) { 78 for (int i = 0; i < count; i++) {
79 picked.add(list[rng.nextInt(list.length)]); 79 picked.add(list[rng.nextInt(list.length)]);
80 } 80 }
81 return picked; 81 return picked;
82 } 82 }
83 83
(...skipping 19 matching lines...) Expand all
103 } 103 }
104 104
105 void _handleMenuClick(_) { 105 void _handleMenuClick(_) {
106 _drawer.toggle(); 106 _drawer.toggle();
107 } 107 }
108 } 108 }
109 109
110 _init(script) => register(script, Stocks); 110 _init(script) => register(script, Stocks);
111 </script> 111 </script>
112 </sky-element> 112 </sky-element>
OLDNEW
« no previous file with comments | « sky/examples/stocks/companylist.sky ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698