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

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

Issue 2645273002: [MD Bookmarks] Modify search to retain the previously selected folder. (Closed)
Patch Set: Rebase and update test to use selectFolder. Created 3 years, 10 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 /** 6 /**
7 * This element is a one way bound interface that routes the page URL to 7 * This element is a one way bound interface that routes the page URL to
8 * the searchTerm and selectedId. Clients must initialize themselves by 8 * the searchTerm and selectedId. Clients must initialize themselves by
9 * reading the router's fields after attach. 9 * reading the router's fields after attach.
10 */ 10 */
(...skipping 17 matching lines...) Expand all
28 }, 28 },
29 29
30 observers: [ 30 observers: [
31 'onQueryChanged_(queryParams_.*)', 31 'onQueryChanged_(queryParams_.*)',
32 ], 32 ],
33 33
34 /** @private */ 34 /** @private */
35 onQueryChanged_: function() { 35 onQueryChanged_: function() {
36 this.searchTerm = this.queryParams_.q || ''; 36 this.searchTerm = this.queryParams_.q || '';
37 this.selectedId = this.queryParams_.id; 37 this.selectedId = this.queryParams_.id;
38 38 this.fire('selected-folder-changed', {id: this.selectedId});
39 if (this.searchTerm) 39 this.fire('search-term-changed', this.searchTerm);
40 this.fire('search-term-changed', this.searchTerm);
41 else
42 this.fire('selected-folder-changed', this.selectedId);
43 }, 40 },
44 41
45 /** @private */ 42 /** @private */
46 onSelectedIdChanged_: function() { 43 onSelectedIdChanged_: function() {
47 this.set('queryParams_.id', this.selectedId || null); 44 this.set('queryParams_.id', this.selectedId || null);
48 }, 45 },
49 46
50 /** @private */ 47 /** @private */
51 onSearchTermChanged_: function() { 48 onSearchTermChanged_: function() {
52 this.set('queryParams_.q', this.searchTerm || null); 49 this.set('queryParams_.q', this.searchTerm || null);
53 }, 50 },
54 }); 51 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/item.js ('k') | chrome/browser/resources/md_bookmarks/store.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698