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

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

Issue 2924953003: [MD Bookmarks] Scroll list to top on folder change. (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_bookmarks/list.js
diff --git a/chrome/browser/resources/md_bookmarks/list.js b/chrome/browser/resources/md_bookmarks/list.js
index cb0bdb9a9e8b464876d9698c91f35c2b7826c86e..a4a5f15bec741b036f67bc545b3bd4fcb620d46c 100644
--- a/chrome/browser/resources/md_bookmarks/list.js
+++ b/chrome/browser/resources/md_bookmarks/list.js
@@ -32,7 +32,16 @@ Polymer({
},
/** @private */
- searchTerm_: String,
+ searchTerm_: {
+ type: String,
+ observer: 'onDisplayedListSourceChange_',
+ },
+
+ /** @private */
+ selectedFolder_: {
+ type: String,
+ observer: 'onDisplayedListSourceChange_',
+ },
},
listeners: {
@@ -49,6 +58,9 @@ Polymer({
this.watch('searchTerm_', function(state) {
return state.search.term;
});
+ this.watch('selectedFolder_', function(state) {
+ return state.selectedFolder;
+ });
this.updateFromStore();
this.$.bookmarksCard.addEventListener(
@@ -90,6 +102,11 @@ Polymer({
}
},
+ /** @private */
+ onDisplayedListSourceChange_: function() {
+ this.scrollTop = 0;
+ },
+
/** @private */
emptyListMessage_: function() {
var emptyListMessage = this.searchTerm_ ? 'noSearchResults' : 'emptyList';
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698