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

Unified Diff: chrome/browser/resources/md_bookmarks/item.js

Issue 2888863002: [MD Bookmarks] Refine mouse selection (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_bookmarks/item.js
diff --git a/chrome/browser/resources/md_bookmarks/item.js b/chrome/browser/resources/md_bookmarks/item.js
index dbfcb47b4f271e3ce402ed498d9ab7eb06374514..39330796f686e274834e13bd677d3a1b80160986 100644
--- a/chrome/browser/resources/md_bookmarks/item.js
+++ b/chrome/browser/resources/md_bookmarks/item.js
@@ -75,8 +75,12 @@ Polymer({
onContextMenu_: function(e) {
e.preventDefault();
if (!this.isSelectedItem_) {
- this.dispatch(bookmarks.actions.selectItem(
- this.itemId, false, false, this.getState()));
+ this.dispatch(bookmarks.actions.selectItem(this.itemId, this.getState(), {
tsergeant 2017/05/18 23:13:37 I think it would be nice to pull out this and the
calamity 2017/05/19 06:46:56 Done.
+ add: false,
+ range: false,
+ toggle: false,
+ updateAnchor: true,
+ }));
}
this.fire('open-item-menu', {
x: e.clientX,
@@ -90,8 +94,12 @@ Polymer({
*/
onMenuButtonClick_: function(e) {
e.stopPropagation();
- this.dispatch(bookmarks.actions.selectItem(
- this.itemId, false, false, this.getState()));
+ this.dispatch(bookmarks.actions.selectItem(this.itemId, this.getState(), {
+ add: false,
+ range: false,
+ toggle: false,
+ updateAnchor: true,
+ }));
this.fire('open-item-menu', {
targetElement: e.target,
});
@@ -137,8 +145,12 @@ Polymer({
* @private
*/
onClick_: function(e) {
- this.dispatch(bookmarks.actions.selectItem(
- this.itemId, e.ctrlKey, e.shiftKey, this.getState()));
+ this.dispatch(bookmarks.actions.selectItem(this.itemId, this.getState(), {
+ add: e.ctrlKey,
+ range: e.shiftKey,
+ toggle: e.ctrlKey && !e.shiftKey,
+ updateAnchor: !e.shiftKey,
+ }));
e.stopPropagation();
},

Powered by Google App Engine
This is Rietveld 408576698