Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1272)

Side by Side Diff: chrome/browser/resources/shared/js/cr/ui/array_data_model.js

Issue 8548012: Added "select all/none" checkbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview This is a data model representin 6 * @fileoverview This is a data model representin
7 */ 7 */
8 8
9 cr.define('cr.ui', function() { 9 cr.define('cr.ui', function() {
10 const EventTarget = cr.EventTarget; 10 const EventTarget = cr.EventTarget;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 this.compareFunctions_ = {}; 70 this.compareFunctions_ = {};
71 } 71 }
72 this.compareFunctions_[field] = compareFunction; 72 this.compareFunctions_[field] = compareFunction;
73 }, 73 },
74 74
75 isSortable: function(field) { 75 isSortable: function(field) {
76 return this.compareFunctions_ && field in this.compareFunctions_; 76 return this.compareFunctions_ && field in this.compareFunctions_;
77 }, 77 },
78 78
79 /** 79 /**
80 * Returns true if the field has a compare function.
81 * @param {string} field The field to check.
82 * @return {boolean} True if the field is sortable.
83 */
84 isSortable: function(field) {
85 return this.compareFunctions_ && field in this.compareFunctions_;
86 },
87
88 /**
80 * Returns current sort status. 89 * Returns current sort status.
81 * @return {!Object} Current sort status. 90 * @return {!Object} Current sort status.
82 */ 91 */
83 get sortStatus() { 92 get sortStatus() {
84 if (this.sortStatus_) { 93 if (this.sortStatus_) {
85 return this.createSortStatus( 94 return this.createSortStatus(
86 this.sortStatus_.field, this.sortStatus_.direction); 95 this.sortStatus_.field, this.sortStatus_.direction);
87 } else { 96 } else {
88 return this.createSortStatus(null, null); 97 return this.createSortStatus(null, null);
89 } 98 }
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 if (a > b) 367 if (a > b)
359 return 1; 368 return 1;
360 return 0; 369 return 0;
361 } 370 }
362 }; 371 };
363 372
364 return { 373 return {
365 ArrayDataModel: ArrayDataModel 374 ArrayDataModel: ArrayDataModel
366 }; 375 };
367 }); 376 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698