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: 'history-app', | 6 is: 'history-app', |
7 | 7 |
8 properties: { | 8 properties: { |
9 // The id of the currently selected page. | 9 // The id of the currently selected page. |
10 selectedPage_: {type: String, value: 'history', observer: 'unselectAll'}, | 10 selectedPage_: {type: String, value: 'history', observer: 'unselectAll'}, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 * Listens for history-item being selected or deselected (through checkbox) | 70 * Listens for history-item being selected or deselected (through checkbox) |
71 * and changes the view of the top toolbar. | 71 * and changes the view of the top toolbar. |
72 * @param {{detail: {countAddition: number}}} e | 72 * @param {{detail: {countAddition: number}}} e |
73 */ | 73 */ |
74 checkboxSelected: function(e) { | 74 checkboxSelected: function(e) { |
75 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar); | 75 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar); |
76 toolbar.count += e.detail.countAddition; | 76 toolbar.count += e.detail.countAddition; |
77 }, | 77 }, |
78 | 78 |
79 /** | 79 /** |
| 80 * @return {HistorySideBarElement} The side bar of this history app. |
| 81 */ |
| 82 getSideBar: function() { |
| 83 return this.$['side-bar']; |
| 84 }, |
| 85 |
| 86 /** |
80 * Listens for call to cancel selection and loops through all items to set | 87 * Listens for call to cancel selection and loops through all items to set |
81 * checkbox to be unselected. | 88 * checkbox to be unselected. |
82 * @private | 89 * @private |
83 */ | 90 */ |
84 unselectAll: function() { | 91 unselectAll: function() { |
85 var listContainer = | 92 var listContainer = |
86 /** @type {HistoryListContainerElement} */ (this.$['history']); | 93 /** @type {HistoryListContainerElement} */ (this.$['history']); |
87 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar); | 94 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar); |
88 listContainer.unselectAllItems(toolbar.count); | 95 listContainer.unselectAllItems(toolbar.count); |
89 toolbar.count = 0; | 96 toolbar.count = 0; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 * @param {boolean} incremental | 174 * @param {boolean} incremental |
168 * @param {string} searchTerm | 175 * @param {string} searchTerm |
169 * @return {boolean} Whether a loading spinner should be shown (implies the | 176 * @return {boolean} Whether a loading spinner should be shown (implies the |
170 * backend is querying a new search term). | 177 * backend is querying a new search term). |
171 * @private | 178 * @private |
172 */ | 179 */ |
173 shouldShowSpinner_: function(querying, incremental, searchTerm) { | 180 shouldShowSpinner_: function(querying, incremental, searchTerm) { |
174 return querying && !incremental && searchTerm != ''; | 181 return querying && !incremental && searchTerm != ''; |
175 }, | 182 }, |
176 }); | 183 }); |
OLD | NEW |