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

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

Issue 2777503002: [MD Bookmarks] Deselect items when clicking outside the bookmark card. (Closed)
Patch Set: rebase Created 3 years, 8 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-list', 6 is: 'bookmarks-list',
7 7
8 behaviors: [ 8 behaviors: [
9 bookmarks.StoreClient, 9 bookmarks.StoreClient,
10 ], 10 ],
(...skipping 10 matching lines...) Expand all
21 // hide #bookmarksCard takes effect. 21 // hide #bookmarksCard takes effect.
22 return []; 22 return [];
23 }, 23 },
24 }, 24 },
25 25
26 /** @private */ 26 /** @private */
27 searchTerm_: String, 27 searchTerm_: String,
28 }, 28 },
29 29
30 listeners: { 30 listeners: {
31 'click': 'deselectItems_',
31 'open-item-menu': 'onOpenItemMenu_', 32 'open-item-menu': 'onOpenItemMenu_',
32 }, 33 },
33 34
34 attached: function() { 35 attached: function() {
35 this.watch('displayedList_', function(state) { 36 this.watch('displayedList_', function(state) {
36 return bookmarks.util.getDisplayedList(state); 37 return bookmarks.util.getDisplayedList(state);
37 }); 38 });
38 this.watch('searchTerm_', function(state) { 39 this.watch('searchTerm_', function(state) {
39 return state.search.term; 40 return state.search.term;
40 }); 41 });
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 /** @private */ 99 /** @private */
99 emptyListMessage_: function() { 100 emptyListMessage_: function() {
100 var emptyListMessage = this.searchTerm_ ? 'noSearchResults' : 'emptyList'; 101 var emptyListMessage = this.searchTerm_ ? 'noSearchResults' : 'emptyList';
101 return loadTimeData.getString(emptyListMessage); 102 return loadTimeData.getString(emptyListMessage);
102 }, 103 },
103 104
104 /** @private */ 105 /** @private */
105 isEmptyList_: function() { 106 isEmptyList_: function() {
106 return this.displayedList_.length == 0; 107 return this.displayedList_.length == 0;
107 }, 108 },
109
110 /** @private */
111 deselectItems_: function() {
112 this.dispatch(bookmarks.actions.deselectItems());
113 },
108 }); 114 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/item.js ('k') | chrome/browser/resources/md_bookmarks/reducers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698