| 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 showSidebarFooter: Boolean, | 9 showSidebarFooter: Boolean, |
| 10 | 10 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 drawer.toggle(); | 100 drawer.toggle(); |
| 101 }, | 101 }, |
| 102 | 102 |
| 103 /** | 103 /** |
| 104 * Listens for history-item being selected or deselected (through checkbox) | 104 * Listens for history-item being selected or deselected (through checkbox) |
| 105 * and changes the view of the top toolbar. | 105 * and changes the view of the top toolbar. |
| 106 * @param {{detail: {countAddition: number}}} e | 106 * @param {{detail: {countAddition: number}}} e |
| 107 */ | 107 */ |
| 108 checkboxSelected: function(e) { | 108 checkboxSelected: function(e) { |
| 109 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar); | 109 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar); |
| 110 toolbar.count += e.detail.countAddition; | 110 toolbar.count = /** @type {HistoryListContainerElement} */ (this.$.history) |
| 111 .getSelectedItemCount(); |
| 111 }, | 112 }, |
| 112 | 113 |
| 113 /** | 114 /** |
| 114 * Listens for call to cancel selection and loops through all items to set | 115 * Listens for call to cancel selection and loops through all items to set |
| 115 * checkbox to be unselected. | 116 * checkbox to be unselected. |
| 116 * @private | 117 * @private |
| 117 */ | 118 */ |
| 118 unselectAll: function() { | 119 unselectAll: function() { |
| 119 var listContainer = | 120 var listContainer = |
| 120 /** @type {HistoryListContainerElement} */ (this.$['history']); | 121 /** @type {HistoryListContainerElement} */ (this.$.history); |
| 121 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar); | 122 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar); |
| 122 listContainer.unselectAllItems(toolbar.count); | 123 listContainer.unselectAllItems(toolbar.count); |
| 123 toolbar.count = 0; | 124 toolbar.count = 0; |
| 124 }, | 125 }, |
| 125 | 126 |
| 126 deleteSelected: function() { | 127 deleteSelected: function() { |
| 127 this.$.history.deleteSelectedWithPrompt(); | 128 this.$.history.deleteSelectedWithPrompt(); |
| 128 }, | 129 }, |
| 129 | 130 |
| 130 /** | 131 /** |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 return selectedPage; | 276 return selectedPage; |
| 276 }, | 277 }, |
| 277 | 278 |
| 278 /** @private */ | 279 /** @private */ |
| 279 closeDrawer_: function() { | 280 closeDrawer_: function() { |
| 280 var drawer = this.$$('#drawer'); | 281 var drawer = this.$$('#drawer'); |
| 281 if (drawer) | 282 if (drawer) |
| 282 drawer.close(); | 283 drawer.close(); |
| 283 }, | 284 }, |
| 284 }); | 285 }); |
| OLD | NEW |