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

Unified Diff: chrome/browser/resources/bookmark_manager/js/main.js

Issue 1059323004: Add newly added page or folder last when multiple bookmarks are selected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/bookmark_manager/js/main.js
diff --git a/chrome/browser/resources/bookmark_manager/js/main.js b/chrome/browser/resources/bookmark_manager/js/main.js
index efbac59bd3aa75e3867bbfc290ad7d0e696df657..acfc3d7db701566ae61ea65a88c2c33d5ebf04f4 100644
--- a/chrome/browser/resources/bookmark_manager/js/main.js
+++ b/chrome/browser/resources/bookmark_manager/js/main.js
@@ -1029,13 +1029,13 @@ function newFolder(opt_target) {
performGlobalUndo = null; // This can't be undone, so disable global undo.
var parentId = computeParentFolderForNewItem();
- var selectedItem = bmm.list.selectedItem;
+ var selectedItems = bmm.list.selectedItems;
var newIndex;
// Callback is called after tree and list data model updated.
function createFolder(callback) {
- if (selectedItem && document.activeElement != bmm.tree &&
- !bmm.isFolder(selectedItem) && selectedItem.id != 'new') {
- newIndex = bmm.list.dataModel.indexOf(selectedItem) + 1;
+ if (selectedItems.length == 1 && document.activeElement != bmm.tree &&
+ !bmm.isFolder(selectedItems[0]) && selectedItems[0].id != 'new') {
+ newIndex = bmm.list.dataModel.indexOf(selectedItems[0]) + 1;
}
chrome.bookmarks.create({
title: loadTimeData.getString('new_folder_name'),
@@ -1086,12 +1086,12 @@ function scrollIntoViewAndMakeEditable(index) {
*/
function addPage() {
var parentId = computeParentFolderForNewItem();
- var selectedItem = bmm.list.selectedItem;
+ var selectedItems = bmm.list.selectedItems;
var newIndex;
function editNewBookmark() {
- if (selectedItem && document.activeElement != bmm.tree &&
- !bmm.isFolder(selectedItem)) {
- newIndex = bmm.list.dataModel.indexOf(selectedItem) + 1;
+ if (selectedItems.length == 1 && document.activeElement != bmm.tree &&
+ !bmm.isFolder(selectedItems[0])) {
+ newIndex = bmm.list.dataModel.indexOf(selectedItems[0]) + 1;
}
var fakeNode = {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698