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, |
}; |
} |