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..44d4d19f3cb0ed367322376048fa04ef58614b8b 100644 |
--- a/chrome/browser/resources/md_bookmarks/app.js |
+++ b/chrome/browser/resources/md_bookmarks/app.js |
@@ -82,15 +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', function(e) { |
this.updateSidebarWidth_(); |
}.bind(this)); |
Dan Beam
2017/04/11 01:27:02
nit: could also be
splitter.addEventListener('dra
calamity
2017/04/11 03:31:39
Done.
|