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

Side by Side Diff: chrome/browser/resources/md_history/history_item.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: address comments 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 cr.define('md_history', function() { 5 cr.define('md_history', function() {
6 var HistoryItem = Polymer({ 6 var HistoryItem = Polymer({
7 is: 'history-item', 7 is: 'history-item',
8 8
9 properties: { 9 properties: {
10 // Underlying HistoryEntry data for this item. Contains read-only fields 10 // Underlying HistoryEntry data for this item. Contains read-only fields
(...skipping 19 matching lines...) Expand all
30 30
31 numberOfItems: {type: Number}, 31 numberOfItems: {type: Number},
32 32
33 // The path of this history item inside its parent. 33 // The path of this history item inside its parent.
34 path: String, 34 path: String,
35 }, 35 },
36 36
37 /** 37 /**
38 * When a history-item is selected the toolbar is notified and increases 38 * When a history-item is selected the toolbar is notified and increases
39 * or decreases its count of selected items accordingly. 39 * or decreases its count of selected items accordingly.
40 * @param {MouseEvent} e
40 * @private 41 * @private
41 */ 42 */
42 onCheckboxSelected_: function() { 43 onCheckboxSelected_: function(e) {
43 // TODO(calamity): Fire this event whenever |selected| changes. 44 // TODO(calamity): Fire this event whenever |selected| changes.
44 this.fire('history-checkbox-select', { 45 this.fire('history-checkbox-select', {
45 element: this, 46 element: this,
46 countAddition: this.$.checkbox.checked ? 1 : -1 47 shiftKey: e.shiftKey,
47 }); 48 });
49 e.preventDefault();
50 },
51
52 /*
tsergeant 2016/08/16 01:26:00 /** to fix closure
53 * @param {MouseEvent} e
54 * @private
55 */
56 onCheckboxMousedown_: function(e) {
57 // Prevent shift clicking a checkbox from selecting text.
58 if (e.shiftKey)
59 e.preventDefault();
48 }, 60 },
49 61
50 /** 62 /**
51 * Remove bookmark of current item when bookmark-star is clicked. 63 * Remove bookmark of current item when bookmark-star is clicked.
52 * @private 64 * @private
53 */ 65 */
54 onRemoveBookmarkTap_: function() { 66 onRemoveBookmarkTap_: function() {
55 if (!this.item.starred) 67 if (!this.item.starred)
56 return; 68 return;
57 69
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 148
137 if (searchedTerm) 149 if (searchedTerm)
138 return currentItem.dateShort != nextItem.dateShort; 150 return currentItem.dateShort != nextItem.dateShort;
139 151
140 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && 152 return currentItem.time - nextItem.time > BROWSING_GAP_TIME &&
141 currentItem.dateRelativeDay == nextItem.dateRelativeDay; 153 currentItem.dateRelativeDay == nextItem.dateRelativeDay;
142 }; 154 };
143 155
144 return { HistoryItem: HistoryItem }; 156 return { HistoryItem: HistoryItem };
145 }); 157 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/history_item.html ('k') | chrome/browser/resources/md_history/history_list_behavior.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698