| Index: appengine/sheriff_o_matic/ui/ct-last-updated.html
|
| diff --git a/appengine/sheriff_o_matic/ui/ct-last-updated.html b/appengine/sheriff_o_matic/ui/ct-last-updated.html
|
| index 0ebb76f81e1240ddfa2216a47b587411149197fb..cace88c6647f2962307ace39197a0deacff60ad7 100644
|
| --- a/appengine/sheriff_o_matic/ui/ct-last-updated.html
|
| +++ b/appengine/sheriff_o_matic/ui/ct-last-updated.html
|
| @@ -2,11 +2,9 @@
|
| Copyright 2014 The Chromium Authors. All rights reserved.
|
| Use of this source code is governed by a BSD-style license that can be
|
| found in the LICENSE file.
|
| --->
|
| -
|
| -<polymer-element name="ct-last-updated" attributes="date">
|
| +--><html><head><dom-module id="ct-last-updated">
|
| <template>
|
| - <template if="{{ date }}">
|
| + <template is="dom-if" if="{{ date }}">
|
| <style>
|
| .stale_5minutes {
|
| color: orange;
|
| @@ -25,38 +23,43 @@ found in the LICENSE file.
|
| display: none;
|
| }
|
| </style>
|
| - <span class="{{ date | _style }}">Updated @ {{ date | _hours }}:{{ date | _minutes }}</span>
|
| - <span class='{{ date | _dateStyle }}'>{{ date | _date }}</span>
|
| + <span class$="{{_style ( date)}}">Updated @ <span>{{_hours ( date)}}</span>:<span>{{_minutes ( date)}}</span></span>
|
| + <span class$="{{_dateStyle ( date)}}">{{_date ( date)}}</span>
|
| </template>
|
| </template>
|
| <script>
|
| - (function() {
|
| - Polymer({
|
| - date: null,
|
| - _style: function(date) {
|
| - var staleness = date.minutesAgo();
|
| - if (staleness >= 20)
|
| - return "stale_20minutes";
|
| - if (staleness >= 10)
|
| - return "stale_10minutes";
|
| - if (staleness >= 5)
|
| - return "stale_5minutes";
|
| - return "";
|
| - },
|
| - _hours: function(date) {
|
| - return date.getHours();
|
| - },
|
| - _minutes: function(date) {
|
| - return date.getMinutes().toString().padLeft(2, '0');
|
| - },
|
| - _date: function(date) {
|
| - return date.toDateString();
|
| - },
|
| - _dateStyle: function(date) {
|
| - return date.hoursAgo() > 12 ? 'date_shown' : 'date_hidden';
|
| - },
|
| - });
|
| - })();
|
| -
|
| + (function () {
|
| + Polymer({
|
| + is: 'ct-last-updated',
|
| + properties: {
|
| + date: {
|
| + value: null,
|
| + notify: true
|
| + }
|
| + },
|
| + _style: function (date) {
|
| + var staleness = date.minutesAgo();
|
| + if (staleness >= 20)
|
| + return 'stale_20minutes';
|
| + if (staleness >= 10)
|
| + return 'stale_10minutes';
|
| + if (staleness >= 5)
|
| + return 'stale_5minutes';
|
| + return '';
|
| + },
|
| + _hours: function (date) {
|
| + return date.getHours();
|
| + },
|
| + _minutes: function (date) {
|
| + return date.getMinutes().toString().padLeft(2, '0');
|
| + },
|
| + _date: function (date) {
|
| + return date.toDateString();
|
| + },
|
| + _dateStyle: function (date) {
|
| + return date.hoursAgo() > 12 ? 'date_shown' : 'date_hidden';
|
| + }
|
| + });
|
| + }());
|
| </script>
|
| -</polymer-element>
|
| +</dom-module>
|
|
|