| 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-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 Loading... |
| 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 Loading... |
| 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 }); |
| OLD | NEW |