OLD | NEW |
---|---|
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 behaviors: [ | 8 behaviors: [ |
9 bookmarks.StoreClient, | 9 bookmarks.StoreClient, |
10 ], | 10 ], |
(...skipping 26 matching lines...) Expand all Loading... | |
37 /** | 37 /** |
38 * @param {Event} e | 38 * @param {Event} e |
39 * @private | 39 * @private |
40 */ | 40 */ |
41 onMenuButtonOpenTap_: function(e) { | 41 onMenuButtonOpenTap_: function(e) { |
42 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); | 42 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); |
43 menu.showAt(/** @type {!Element} */ (e.target)); | 43 menu.showAt(/** @type {!Element} */ (e.target)); |
44 }, | 44 }, |
45 | 45 |
46 /** @private */ | 46 /** @private */ |
47 onBulkEditTap_: function() { | |
48 this.closeDropdownMenu_(); | |
49 }, | |
50 | |
51 /** @private */ | |
52 onSortTap_: function() { | 47 onSortTap_: function() { |
53 this.closeDropdownMenu_(); | 48 this.closeDropdownMenu_(); |
54 }, | 49 }, |
55 | 50 |
56 /** @private */ | 51 /** @private */ |
57 onAddBookmarkTap_: function() { | 52 onAddBookmarkTap_: function() { |
53 var dialog = | |
54 /** @type {BookmarksEditDialogElement} */ (this.$.addDialog.get()); | |
55 dialog.showAddDialog(false, assert(this.getState().selectedFolder)); | |
58 this.closeDropdownMenu_(); | 56 this.closeDropdownMenu_(); |
59 }, | 57 }, |
60 | 58 |
59 onAddFolderTap_: function() { | |
60 var dialog = | |
61 /** @type {BookmarksEditDialogElement} */ (this.$.addDialog.get()); | |
62 dialog.showAddDialog(true, assert(this.getState().selectedFolder)); | |
63 this.closeDropdownMenu_(); | |
64 }, | |
65 | |
61 /** @private */ | 66 /** @private */ |
62 onImportTap_: function() { | 67 onImportTap_: function() { |
63 chrome.bookmarks.import(); | 68 chrome.bookmarks.import(); |
64 this.closeDropdownMenu_(); | 69 this.closeDropdownMenu_(); |
65 }, | 70 }, |
66 | 71 |
67 /** @private */ | 72 /** @private */ |
68 onExportTap_: function() { | 73 onExportTap_: function() { |
69 chrome.bookmarks.export(); | 74 chrome.bookmarks.export(); |
70 this.closeDropdownMenu_(); | 75 this.closeDropdownMenu_(); |
(...skipping 16 matching lines...) Expand all Loading... | |
87 }, | 92 }, |
88 | 93 |
89 onSidebarWidthChanged_: function() { | 94 onSidebarWidthChanged_: function() { |
90 this.style.setProperty('--sidebar-width', this.sidebarWidth); | 95 this.style.setProperty('--sidebar-width', this.sidebarWidth); |
91 }, | 96 }, |
92 | 97 |
93 /** @private */ | 98 /** @private */ |
94 onSearchTermChanged_: function() { | 99 onSearchTermChanged_: function() { |
95 this.searchField.setValue(this.searchTerm_ || ''); | 100 this.searchField.setValue(this.searchTerm_ || ''); |
96 }, | 101 }, |
102 | |
103 /** | |
104 * @return {boolean} | |
105 * @private | |
106 */ | |
107 isSearchActive_: function() { | |
calamity
2017/04/03 07:20:48
nit: hasSearchTerm_ perhaps? 'Active' search is a
tsergeant
2017/04/04 01:21:08
Renamed.
The util function didn't exist when I fi
| |
108 return !!this.searchTerm_; | |
109 }, | |
97 }); | 110 }); |
OLD | NEW |