| 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 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 /** @private */ | 23 /** @private */ |
| 24 searchTerm_: String, | 24 searchTerm_: String, |
| 25 }, | 25 }, |
| 26 | 26 |
| 27 listeners: { | 27 listeners: { |
| 28 'click': 'deselectItems_', | 28 'click': 'deselectItems_', |
| 29 }, | 29 }, |
| 30 | 30 |
| 31 attached: function() { | 31 attached: function() { |
| 32 var list = /** @type {IronListElement} */ (this.$.bookmarksCard); |
| 33 list.scrollTarget = this; |
| 34 |
| 32 this.watch('displayedList_', function(state) { | 35 this.watch('displayedList_', function(state) { |
| 33 return bookmarks.util.getDisplayedList(state); | 36 return bookmarks.util.getDisplayedList(state); |
| 34 }); | 37 }); |
| 35 this.watch('searchTerm_', function(state) { | 38 this.watch('searchTerm_', function(state) { |
| 36 return state.search.term; | 39 return state.search.term; |
| 37 }); | 40 }); |
| 38 this.updateFromStore(); | 41 this.updateFromStore(); |
| 39 }, | 42 }, |
| 40 | 43 |
| 41 getDropTarget: function() { | 44 getDropTarget: function() { |
| 42 return this.$.message; | 45 return this.$.message; |
| 43 }, | 46 }, |
| 44 | 47 |
| 45 /** @private */ | 48 /** @private */ |
| 46 emptyListMessage_: function() { | 49 emptyListMessage_: function() { |
| 47 var emptyListMessage = this.searchTerm_ ? 'noSearchResults' : 'emptyList'; | 50 var emptyListMessage = this.searchTerm_ ? 'noSearchResults' : 'emptyList'; |
| 48 return loadTimeData.getString(emptyListMessage); | 51 return loadTimeData.getString(emptyListMessage); |
| 49 }, | 52 }, |
| 50 | 53 |
| 51 /** @private */ | 54 /** @private */ |
| 52 isEmptyList_: function() { | 55 isEmptyList_: function() { |
| 53 return this.displayedList_.length == 0; | 56 return this.displayedList_.length == 0; |
| 54 }, | 57 }, |
| 55 | 58 |
| 56 /** @private */ | 59 /** @private */ |
| 57 deselectItems_: function() { | 60 deselectItems_: function() { |
| 58 this.dispatch(bookmarks.actions.deselectItems()); | 61 this.dispatch(bookmarks.actions.deselectItems()); |
| 59 }, | 62 }, |
| 60 }); | 63 }); |
| OLD | NEW |