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

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

Issue 9379023: Tweaks for improving file manager performance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Finish plumbing callbacks through Created 8 years, 10 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
Index: chrome/browser/resources/shared/js/cr/ui/table/table_header.js
diff --git a/chrome/browser/resources/shared/js/cr/ui/table/table_header.js b/chrome/browser/resources/shared/js/cr/ui/table/table_header.js
index 2fa8eaafc786b43afb9330f38469ac17ea4f8f77..d26f8fbbddc18c7455d14b1c3326c9c3f0e015a6 100644
--- a/chrome/browser/resources/shared/js/cr/ui/table/table_header.js
+++ b/chrome/browser/resources/shared/js/cr/ui/table/table_header.js
@@ -62,10 +62,25 @@ cr.define('cr.ui.table', function() {
this.appendSplitters_();
},
+ batchCount_: 0,
+
+ startBatchUpdates: function() {
+ this.batchCount_++;
+ },
+
+ endBatchUpdates: function() {
+ this.batchCount_--;
+ if (this.batchCount_ == 0)
+ this.redraw();
+ },
+
/**
* Redraws table header.
*/
redraw: function() {
+ if (this.batchCount_ != 0)
+ return;
+
var cm = this.table_.columnModel;
var dm = this.table_.dataModel;

Powered by Google App Engine
This is Rietveld 408576698