| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2016 The LUCI Authors. All rights reserved. | 2 Copyright 2016 The LUCI Authors. All rights reserved. |
| 3 Use of this source code is governed under the Apache License, Version 2.0 | 3 Use of this source code is governed under the Apache License, Version 2.0 |
| 4 that can be found in the LICENSE file. | 4 that can be found in the LICENSE file. |
| 5 | 5 |
| 6 This in an HTML Import-able file that contains the definition | 6 This in an HTML Import-able file that contains the definition |
| 7 of the following elements: | 7 of the following elements: |
| 8 | 8 |
| 9 <sort-toggle> | 9 <sort-toggle> |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 style="bottom:0" | 69 style="bottom:0" |
| 70 class$="[[_hidden(direction,'desc')]]" | 70 class$="[[_hidden(direction,'desc')]]" |
| 71 icon="icons:arrow-drop-up"> | 71 icon="icons:arrow-drop-up"> |
| 72 </iron-icon> | 72 </iron-icon> |
| 73 </span> | 73 </span> |
| 74 | 74 |
| 75 </template> | 75 </template> |
| 76 <script> | 76 <script> |
| 77 Polymer({ | 77 Polymer({ |
| 78 is: "sort-toggle", | 78 is: "sort-toggle", |
| 79 |
| 79 properties: { | 80 properties: { |
| 80 current: { | 81 current: { |
| 81 type: Object, | 82 type: Object, |
| 82 observer: "_resetSort", | 83 observer: "_resetSort", |
| 83 }, | 84 }, |
| 84 name: { | 85 name: { |
| 85 type: String, | 86 type: String, |
| 86 observer: "_resetSort", | 87 observer: "_resetSort", |
| 87 }, | 88 }, |
| 88 | 89 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 113 // Because of how Polymer inserts and moves elements around, we need to | 114 // Because of how Polymer inserts and moves elements around, we need to |
| 114 // update the direction value if the name changes so the ascending sort | 115 // update the direction value if the name changes so the ascending sort |
| 115 // by "os" doesn't become the ascending sort by "gpu" if a column gets | 116 // by "os" doesn't become the ascending sort by "gpu" if a column gets |
| 116 // added before "os", for example. Additionally, this makes sure that | 117 // added before "os", for example. Additionally, this makes sure that |
| 117 // only one sort-toggle is active at a given time. | 118 // only one sort-toggle is active at a given time. |
| 118 if (this.current && this.current.name === this.name) { | 119 if (this.current && this.current.name === this.name) { |
| 119 this.set("direction", this.current.direction); | 120 this.set("direction", this.current.direction); |
| 120 } else { | 121 } else { |
| 121 this.set("direction", ""); | 122 this.set("direction", ""); |
| 122 } | 123 } |
| 123 | |
| 124 }, | 124 }, |
| 125 }); | 125 }); |
| 126 </script> | 126 </script> |
| 127 </dom-module> | 127 </dom-module> |
| OLD | NEW |