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

Side by Side Diff: chrome/browser/resources/md_bookmarks/folder_node.js

Issue 2876113002: [MD Bookmarks] Scroll selected folder into view in sidebar. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 Polymer({ 5 Polymer({
6 is: 'bookmarks-folder-node', 6 is: 'bookmarks-folder-node',
7 7
8 behaviors: [ 8 behaviors: [
9 bookmarks.StoreClient, 9 bookmarks.StoreClient,
10 ], 10 ],
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 return state.closedFolders.has(this.itemId); 54 return state.closedFolders.has(this.itemId);
55 }.bind(this)); 55 }.bind(this));
56 this.watch('selectedFolder_', function(state) { 56 this.watch('selectedFolder_', function(state) {
57 return state.selectedFolder; 57 return state.selectedFolder;
58 }); 58 });
59 this.watch('searchActive_', function(state) { 59 this.watch('searchActive_', function(state) {
60 return bookmarks.util.isShowingSearch(state); 60 return bookmarks.util.isShowingSearch(state);
61 }); 61 });
62 62
63 this.updateFromStore(); 63 this.updateFromStore();
64
65 if (this.isSelectedFolder_) {
66 this.async(function() {
67 this.scrollIntoViewIfNeeded();
68 });
69 }
64 }, 70 },
65 71
66 /** @return {HTMLElement} */ 72 /** @return {HTMLElement} */
67 getFocusTarget: function() { 73 getFocusTarget: function() {
68 return this.$.container; 74 return this.$.container;
69 }, 75 },
70 76
71 /** @return {HTMLElement} */ 77 /** @return {HTMLElement} */
72 getDropTarget: function() { 78 getDropTarget: function() {
73 return this.$.container; 79 return this.$.container;
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 }, 298 },
293 299
294 /** 300 /**
295 * @private 301 * @private
296 * @return {string} 302 * @return {string}
297 */ 303 */
298 getTabIndex_: function() { 304 getTabIndex_: function() {
299 return this.isSelectedFolder_ ? '0' : ''; 305 return this.isSelectedFolder_ ? '0' : '';
300 }, 306 },
301 }); 307 });
OLDNEW
« 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