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..ed59f5e4024dd59f92311b4abbaa0e0092f2b278 100644 |
--- a/chrome/browser/resources/md_bookmarks/app.js |
+++ b/chrome/browser/resources/md_bookmarks/app.js |
@@ -82,18 +82,19 @@ 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; |
this.updateSidebarWidth_(); |
}.bind(this)); |
+ splitter.addEventListener('dragmove', this.boundUpdateSidebarWidth_); |
window.addEventListener('resize', this.boundUpdateSidebarWidth_); |
}, |