From c7ef8642f55e6f13fdb16824b9122e8e05ab228a Mon Sep 17 00:00:00 2001 From: limasdf Date: Mon, 21 Sep 2015 19:21:43 -0700 Subject: [PATCH] BookmarkManager: Fix 'new folder text field size changes on clicking it' issue. Fixing regression issue generated by https://crrev.com/349550. Previous patch updates bmm.list.parentId to get correct command info. Because of changing bmm.list.parentId, callback function is called at an unwanted time. To fix this, holding the previous bmm.list.parentId value and use it when calling callback. BUG=533341, 534256 TEST=manual(adding folder, deleting leaf node folder) Review URL: https://codereview.chromium.org/1360493003 Cr-Commit-Position: refs/heads/master@{#350093} --- chrome/browser/resources/bookmark_manager/js/main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chrome/browser/resources/bookmark_manager/js/main.js b/chrome/browser/resources/bookmark_manager/js/main.js index ca2e8330fa70..7dc284f4cdeb 100644 --- a/chrome/browser/resources/bookmark_manager/js/main.js +++ b/chrome/browser/resources/bookmark_manager/js/main.js @@ -156,7 +156,10 @@ function updateHash() { function navigateTo(id, opt_callback) { window.location.hash = id; - updateParentId(id); + var sameParent = bmm.list.parentId == id; + if (!sameParent) + updateParentId(id); + updateAllCommands(); var metricsId = folderMetricsNameMap[id.replace(/^q=.*/, 'q=')] || @@ -165,7 +168,7 @@ function navigateTo(id, opt_callback) { 'BookmarkManager_NavigateTo_' + metricsId); if (opt_callback) { - if (bmm.list.parentId == id) + if (sameParent) opt_callback(); else addOneShotEventListener(bmm.list, 'load', opt_callback); -- 2.11.4.GIT