Chromium Code Reviews| Index: Tools/GardeningServer/ui/ct-tree-status.html |
| diff --git a/Tools/GardeningServer/ui/ct-tree-status.html b/Tools/GardeningServer/ui/ct-tree-status.html |
| index 0ee4d32e8514e2da067cadbf746501d7e8c67054..7cc4b516fc9ecef22cec42747e8f0a3cdee0d58a 100644 |
| --- a/Tools/GardeningServer/ui/ct-tree-status.html |
| +++ b/Tools/GardeningServer/ui/ct-tree-status.html |
| @@ -4,7 +4,7 @@ Use of this source code is governed by a BSD-style license that can be |
| found in the LICENSE file. |
| --> |
| -<polymer-element name="ct-tree-status" attributes="project status"> |
| +<polymer-element name="ct-tree-status"> |
| <template> |
| <style> |
| :host { |
| @@ -23,13 +23,17 @@ found in the LICENSE file. |
| background-color: tomato; |
| } |
| </style> |
| - {{project}}: {{message}} |
| + <template if="{{ message }}"> |
|
abarth-chromium
2014/07/19 04:18:20
Move if to outer template?
ojan
2014/07/19 05:21:43
Good idea. I tried it, but it didn't work. I think
|
| + {{project}}: {{message}} |
| + </template> |
| </template> |
| <script> |
| Polymer({ |
| publish: { |
| + project: '', |
| + message: '', |
| status: { |
| - value: 'unknown', |
| + value: 'open', |
| reflect: true, |
| }, |
| }, |
| @@ -43,18 +47,19 @@ found in the LICENSE file. |
| updateStatus: function(status) { |
| if (status.can_commit_freely) { |
| - this.message = 'Tree is open'; |
| + this.message = ''; |
|
abarth-chromium
2014/07/19 04:18:20
null?
ojan
2014/07/19 05:21:43
How does that work with V8 hidden classes? Will st
|
| this.status = 'open'; |
| + return; |
| + } |
| + |
| + this.message = status.message + ' by ' + status.username; |
| + var responseLowerCase = status.message.toLowerCase(); |
| + if (responseLowerCase.indexOf('throttled') != -1) { |
| + this.status = 'throttled'; |
| + } else if (responseLowerCase.indexOf("closed") != -1) { |
| + this.status = 'closed'; |
| } else { |
| - this.message = status.message + ' by ' + status.username; |
| - var responseLowerCase = status.message.toLowerCase(); |
| - if (responseLowerCase.indexOf('throttled') != -1) { |
| - this.status = 'throttled'; |
| - } else if (responseLowerCase.indexOf("closed") != -1) { |
| - this.status = 'closed'; |
| - } else { |
| - this.status = 'unknown'; |
| - } |
| + this.status = 'unknown'; |
| } |
| }, |
| }); |