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

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

Issue 2614703003: [MD Bookmarks] Add search. (Closed)
Patch Set: Add search result refresh for bookmark editing. Created 3 years, 11 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 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-toolbar', 6 is: 'bookmarks-toolbar',
7 7
8 properties: {
9 searchTerm: {
10 type: String,
11 observer: 'onSearchTermChanged_',
12 },
13 },
14
15 /** @return {CrToolbarSearchFieldElement} */
16 get searchField() {
17 return /** @type {CrToolbarElement} */ (this.$$('cr-toolbar'))
18 .getSearchField();
19 },
20
8 /** 21 /**
9 * @param {Event} e 22 * @param {Event} e
10 * @private 23 * @private
11 */ 24 */
12 onMenuButtonOpenTap_: function(e) { 25 onMenuButtonOpenTap_: function(e) {
13 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); 26 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown);
14 menu.showAt(/** @type {!Element} */ (e.target)); 27 menu.showAt(/** @type {!Element} */ (e.target));
15 }, 28 },
16 29
17 /** @private */ 30 /** @private */
(...skipping 18 matching lines...) Expand all
36 49
37 /** @private */ 50 /** @private */
38 onAddExportTap_: function() { 51 onAddExportTap_: function() {
39 this.closeDropdownMenu_(); 52 this.closeDropdownMenu_();
40 }, 53 },
41 54
42 /** @private */ 55 /** @private */
43 closeDropdownMenu_: function() { 56 closeDropdownMenu_: function() {
44 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); 57 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown);
45 menu.close(); 58 menu.close();
46 } 59 },
60
61 /**
62 * @param {Event} e
63 * @private
64 */
65 onSearchChanged_: function(e) {
66 var searchTerm = /** @type {string} */ (e.detail);
67 this.fire('search-term-changed', searchTerm);
68 },
69
70 /** @private */
71 onSearchTermChanged_: function() {
72 if (!this.searchTerm)
73 this.searchField.setValue('');
74 },
47 }); 75 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698