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

Side by Side Diff: test/fixtures/x_list.dart

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 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 unified diff | Download patch
« no previous file with comments | « test/fixtures/tooltip_button.html ('k') | test/fixtures/x_list.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 @HtmlImport('x_list.html') 4 @HtmlImport('x_list.html')
5 library polymer_elements.test.fixtures.x_list; 5 library polymer_elements.test.fixtures.x_list;
6 6
7 import 'package:polymer/polymer.dart'; 7 import 'package:polymer/polymer.dart';
8 import 'package:polymer_elements/iron_flex_layout.dart'; 8 import 'package:polymer_elements/iron_flex_layout.dart';
9 import 'package:polymer_elements/iron_list.dart'; 9 import 'package:polymer_elements/iron_list.dart';
10 import 'package:web_components/web_components.dart'; 10 import 'package:web_components/web_components.dart';
11 11
12 /// Uses [IronFlexLayout] and [IronList] 12 /// Uses [IronFlexLayout] and [IronList]
13 @PolymerRegister('x-list') 13 @PolymerRegister('x-list')
14 class XList extends PolymerElement { 14 class XList extends PolymerElement {
15 XList.created() : super.created(); 15 XList.created() : super.created();
16 16
17 @property 17 @property
18 List data; 18 List data;
19 19
20 @property 20 @property
21 int itemHeight = 100; 21 int itemHeight = 100;
22 22
23 @property 23 @property
24 int listHeight = 300; 24 int listHeight = 300;
25
26 @property
27 bool pre = false;
25 28
26 get list => $['list']; 29 get list => $['list'];
27 30
28 @reflectable 31 @reflectable
29 String computedItemHeight() => 'height: ${itemHeight}px'; 32 String computedItemHeight(item) {
33 var css = pre ? 'white-space:pre;' : '';
34 if (item['height'] != null && item['height'] != 0) {
35 css += itemHeight == 0 ? '' : 'height: ${item['height']}px;';
36 } else if (itemHeight != 0) {
37 css += 'height: ${itemHeight}px;';
38 }
39 return css;
40 }
30 41
31 @reflectable 42 @reflectable
32 String computedListHeight(listHeight) => 'height: ${listHeight}px'; 43 String computedListHeight(listHeight) => 'height: ${listHeight}px';
33 } 44 }
OLDNEW
« no previous file with comments | « test/fixtures/tooltip_button.html ('k') | test/fixtures/x_list.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698