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

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

Issue 7812018: Revert 98901 - Call prepareSort before any sorting happens. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/shared/js/cr/ui/array_data_model.js
===================================================================
--- chrome/browser/resources/shared/js/cr/ui/array_data_model.js (revision 98912)
+++ chrome/browser/resources/shared/js/cr/ui/array_data_model.js (working copy)
@@ -148,24 +148,20 @@
spliceEvent.added = Array.prototype.slice.call(arguments, 2);
var rv = arr.splice.apply(arr, arguments);
- var self = this;
// if sortStatus.field is null, this restores original order.
- this.prepareSort(this.sortStatus.field, function() {
- var sortPermutation = self.doSort_(self.sortStatus.field,
- self.sortStatus.direction);
- if (sortPermutation) {
- var splicePermutation = deletePermutation.map(function(element) {
- return element != -1 ? sortPermutation[element] : -1;
- });
- self.dispatchPermutedEvent_(splicePermutation);
- } else {
- self.dispatchPermutedEvent_(deletePermutation);
- }
+ var sortPermutation = this.doSort_(this.sortStatus.field,
+ this.sortStatus.direction);
+ if (sortPermutation) {
+ var splicePermutation = deletePermutation.map(function(element) {
+ return element != -1 ? sortPermutation[element] : -1;
+ });
+ this.dispatchPermutedEvent_(splicePermutation);
+ } else {
+ this.dispatchPermutedEvent_(deletePermutation);
+ }
- self.dispatchEvent(spliceEvent);
- });
-
+ this.dispatchEvent(spliceEvent);
return rv;
},
@@ -201,13 +197,10 @@
this.dispatchEvent(e);
if (this.sortStatus.field) {
- var self = this;
- this.prepareSort(self.sortStatus.field, function() {
- var sortPermutation = self.doSort_(self.sortStatus.field,
- self.sortStatus.direction);
- if (sortPermutation)
- self.dispatchPermutedEvent_(sortPermutation);
- });
+ var sortPermutation = this.doSort_(this.sortStatus.field,
+ this.sortStatus.direction);
+ if (sortPermutation)
+ this.dispatchPermutedEvent_(sortPermutation);
}
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698