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

Unified Diff: chrome/browser/resources/md_bookmarks/app.js

Issue 2804543002: [MD Bookmarks] Fix sidebar issues. (Closed)
Patch Set: Created 3 years, 8 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/md_bookmarks/app.js
diff --git a/chrome/browser/resources/md_bookmarks/app.js b/chrome/browser/resources/md_bookmarks/app.js
index 5a8cac2cccbb7a4e037ff08cdd5e3d00764e9fa5..d0bcab9929ff9ecaf8334c18008d261723402881 100644
--- a/chrome/browser/resources/md_bookmarks/app.js
+++ b/chrome/browser/resources/md_bookmarks/app.js
@@ -82,15 +82,18 @@ Polymer({
var splitterTarget = this.$.sidebar;
// The splitter persists the size of the left component in the local store.
- if ('treeWidth' in window.localStorage) {
- splitterTarget.style.width = window.localStorage['treeWidth'];
- this.sidebarWidth_ = splitterTarget.getComputedStyleValue('width');
+ if (LOCAL_STORAGE_TREE_WIDTH_KEY in window.localStorage) {
+ splitterTarget.style.width =
+ window.localStorage[LOCAL_STORAGE_TREE_WIDTH_KEY];
}
+ this.sidebarWidth_ = splitterTarget.getComputedStyleValue('width');
splitter.addEventListener('resize', function(e) {
- window.localStorage['treeWidth'] = splitterTarget.style.width;
- // TODO(calamity): This only fires when the resize is complete. This
- // should be updated on every width change.
+ window.localStorage[LOCAL_STORAGE_TREE_WIDTH_KEY] =
+ splitterTarget.style.width;
+ }.bind(this));
+
+ splitter.addEventListener('dragmove', function(e) {
this.updateSidebarWidth_();
}.bind(this));
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/constants.js » ('j') | chrome/browser/resources/md_bookmarks/constants.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698