OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2017 The Chromium Authors. All rights reserved. | 3 Copyright 2017 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <link rel="import" href="/components/iron-icon/iron-icon.html"> | 8 <link rel="import" href="/components/iron-icon/iron-icon.html"> |
9 <link rel="import" href="/components/iron-icons/iron-icons.html"> | 9 <link rel="import" href="/components/iron-icons/iron-icons.html"> |
10 <link rel="import" href="/components/paper-button/paper-button.html"> | 10 <link rel="import" href="/components/paper-button/paper-button.html"> |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 */ | 245 */ |
246 sort: function() { | 246 sort: function() { |
247 var sortBy = this.sortBy; | 247 var sortBy = this.sortBy; |
248 | 248 |
249 var jobs = this.jobsList.slice(); | 249 var jobs = this.jobsList.slice(); |
250 jobs.sort(function(a, b) { | 250 jobs.sort(function(a, b) { |
251 var valA = String(a[sortBy]).toLowerCase(); | 251 var valA = String(a[sortBy]).toLowerCase(); |
252 var valB = String(b[sortBy]).toLowerCase(); | 252 var valB = String(b[sortBy]).toLowerCase(); |
253 return valA.localeCompare(valB); | 253 return valA.localeCompare(valB); |
254 }); | 254 }); |
255 if (this.sortDescending) | 255 if (this.sortDescending) { |
256 jobs.reverse(); | 256 jobs.reverse(); |
| 257 } |
257 | 258 |
258 this.set('jobsList', jobs); | 259 this.set('jobsList', jobs); |
259 this.updateHeaders(); | 260 this.updateHeaders(); |
260 } | 261 } |
261 }); | 262 }); |
262 })(); | 263 })(); |
263 </script> | 264 </script> |
264 </dom-module> | 265 </dom-module> |
OLD | NEW |