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

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

Issue 2872163002: MD Bookmarks: Add 'Open' command, to open in either the BMM or in new tabs (Closed)
Patch Set: Rebase 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
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/command_manager.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_bookmarks/actions.js
diff --git a/chrome/browser/resources/md_bookmarks/actions.js b/chrome/browser/resources/md_bookmarks/actions.js
index 9f7800a123e1e77cc0ea7ac6664884858cda2030..be264052e0dc394c77c2833081f4fe2faff89633 100644
--- a/chrome/browser/resources/md_bookmarks/actions.js
+++ b/chrome/browser/resources/md_bookmarks/actions.js
@@ -149,6 +149,7 @@ cr.define('bookmarks.actions', function() {
function selectItem(id, add, range, state) {
var anchor = state.selection.anchor;
var toSelect = [];
+ var newAnchor = id;
// TODO(tsergeant): Make it possible to deselect items by ctrl-clicking them
// again.
@@ -160,6 +161,10 @@ cr.define('bookmarks.actions', function() {
if (anchorIndex == -1)
anchorIndex = selectedIndex;
+ // When performing a range selection, don't change the anchor from what
+ // was used in this selection.
+ newAnchor = displayedList[anchorIndex];
+
var startIndex = Math.min(anchorIndex, selectedIndex);
var endIndex = Math.max(anchorIndex, selectedIndex);
@@ -172,7 +177,7 @@ cr.define('bookmarks.actions', function() {
return {
name: 'select-items',
add: add,
- anchor: id,
+ anchor: newAnchor,
items: toSelect,
};
}
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/command_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698