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

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

Issue 8585027: Moving checkboxes to a separate column. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review fix 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 * @param {string} field The field to set compare function. 65 * @param {string} field The field to set compare function.
66 * @param {function(*, *): number} Compare function to set for given field. 66 * @param {function(*, *): number} Compare function to set for given field.
67 */ 67 */
68 setCompareFunction: function(field, compareFunction) { 68 setCompareFunction: function(field, compareFunction) {
69 if (!this.compareFunctions_) { 69 if (!this.compareFunctions_) {
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) {
76 return this.compareFunctions_ && field in this.compareFunctions_;
77 },
78
75 /** 79 /**
76 * Returns current sort status. 80 * Returns current sort status.
77 * @return {!Object} Current sort status. 81 * @return {!Object} Current sort status.
78 */ 82 */
79 get sortStatus() { 83 get sortStatus() {
80 if (this.sortStatus_) { 84 if (this.sortStatus_) {
81 return this.createSortStatus( 85 return this.createSortStatus(
82 this.sortStatus_.field, this.sortStatus_.direction); 86 this.sortStatus_.field, this.sortStatus_.direction);
83 } else { 87 } else {
84 return this.createSortStatus(null, null); 88 return this.createSortStatus(null, null);
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 if (a > b) 358 if (a > b)
355 return 1; 359 return 1;
356 return 0; 360 return 0;
357 } 361 }
358 }; 362 };
359 363
360 return { 364 return {
361 ArrayDataModel: ArrayDataModel 365 ArrayDataModel: ArrayDataModel
362 }; 366 };
363 }); 367 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/file_manager/main.html ('k') | chrome/browser/resources/shared/js/cr/ui/table/table_header.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698