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

Side by Side Diff: chrome/browser/resources/md_history/app.js

Issue 2239623002: [MD History] Add shift-selection to the history lists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@reshadow
Patch Set: rebase, fix closure compile Created 4 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/history_item.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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: '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
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
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 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/history_item.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698