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

Unified Diff: chrome/browser/resources/file_manager/js/file_table.js

Issue 15809008: Make resizing in Files.app more responsive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 7 years, 7 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 | « chrome/browser/resources/file_manager/js/file_manager.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/file_table.js
diff --git a/chrome/browser/resources/file_manager/js/file_table.js b/chrome/browser/resources/file_manager/js/file_table.js
index 6adac0d23276eea2ea0624239e7a488e43a72cf1..d18c3c2596d494d9fff7b7f5354bd7b16ff89438 100644
--- a/chrome/browser/resources/file_manager/js/file_table.js
+++ b/chrome/browser/resources/file_manager/js/file_table.js
@@ -163,6 +163,9 @@ FileTable.decorate = function(self, metadataCache, fullPage) {
self.updateSelectAllCheckboxState_(selectAll);
};
+ self.relayoutAggregation_ =
+ new AsyncUtil.Aggregation(self.relayoutImmediately_.bind(self));
+
Object.defineProperty(self.list_, 'selectionModel', {
get: function() {
return this.selectionModel_;
@@ -669,19 +672,20 @@ FileTable.prototype.renderIconType_ = function(entry, columnId, table) {
* Redraws the UI. Skips multiple consecutive calls.
*/
FileTable.prototype.relayout = function() {
- if (this.resizeTableTimer_) {
- clearTimeout(this.resizeTableTimer_);
- this.resizeTableTimer_ = null;
+ this.relayoutAggregation_.run();
+};
+
+/**
+ * Redraws the UI immediately.
+ * @private
+ */
+FileTable.prototype.relayoutImmediately_ = function() {
+ if (util.platform.newUI()) {
+ if (this.clientWidth > 0)
+ this.normalizeColumns();
}
- this.resizeTableTimer_ = setTimeout(function() {
- if (util.platform.newUI()) {
- if (this.clientWidth > 0)
- this.normalizeColumns();
- }
- this.redraw();
- cr.dispatchSimpleEvent(this.list, 'relayout');
- this.resizeTableTimer_ = null;
- }.bind(this), 100);
+ this.redraw();
+ cr.dispatchSimpleEvent(this.list, 'relayout');
};
/**
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698