OLD | NEW |
---|---|
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 | 6 |
7 <polymer-element name="ct-last-updated" attributes="date"> | 7 <polymer-element name="ct-last-updated" attributes="date"> |
8 <template> | 8 <template> |
9 Updated {{ date | _deltaMinutes }} min ago @ {{ date | _hours }}:{{ date | _ minutes }} | 9 <style> |
10 .hidden { | |
11 opacity: 0; | |
12 } | |
13 </style> | |
14 <span class="{{ { hidden: !visible } | tokenList }}">Updated {{ date | _delt aMinutes }} min ago @ {{ date | _hours }}:{{ date | _minutes }}</span> | |
ojan
2014/08/12 17:39:05
I think your <template if> problem is likely that
teravest
2014/08/12 19:31:41
I've changed this to use an inner template tag as
| |
10 </template> | 15 </template> |
11 <script> | 16 <script> |
12 (function() { | 17 (function() { |
13 Polymer({ | 18 Polymer({ |
14 date: new Date(0), | 19 date: new Date(0), |
20 visible: false, | |
21 | |
22 dateChanged: function() { | |
23 this.visible = true; | |
24 }, | |
15 | 25 |
16 _deltaMinutes: function(date) { | 26 _deltaMinutes: function(date) { |
17 return date.minutesAgo(); | 27 return date.minutesAgo(); |
18 }, | 28 }, |
19 _hours: function(date) { | 29 _hours: function(date) { |
20 return date.getHours(); | 30 return date.getHours(); |
21 }, | 31 }, |
22 _minutes: function(date) { | 32 _minutes: function(date) { |
23 return date.getMinutes(); | 33 return date.getMinutes(); |
24 }, | 34 }, |
25 }); | 35 }); |
26 })(); | 36 })(); |
27 | 37 |
28 </script> | 38 </script> |
29 </polymer-element> | 39 </polymer-element> |
OLD | NEW |