Bug 234973 - Make selected row visible after removing/editing entries in password manager. r=Dolske
authorAshhar Hasan <hashhar_dev@outlook.com>
Mon, 13 Mar 2017 03:26:58 +0530
changeset 356414 a3a3e0d6518f
parent 356413 78db1dc63e9e
child 356415 f8d33ddbaeb4
push id31763
push usercbook@mozilla.com
push dateThu, 04 May 2017 08:55:02 +0000
treeherdermozilla-central@a8d597ee6dd5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersDolske
bugs234973
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 234973 - Make selected row visible after removing/editing entries in password manager. r=Dolske Added a call to 'treeBoxObject.ensureRowIsVisible(signonsTree.view.selection.currentIndex)' in 'signonReloadDisplay()' to make sure the selection is visible regardless of the operation which caused a call to signonReloadDisplay(). MozReview-Commit-ID: EztJ4sZcofi
toolkit/components/passwordmgr/content/passwordManager.js
--- a/toolkit/components/passwordmgr/content/passwordManager.js
+++ b/toolkit/components/passwordmgr/content/passwordManager.js
@@ -46,16 +46,17 @@ let signonReloadDisplay = {
             return;
           }
           signons.length = 0;
           LoadSignons();
           // apply the filter if needed
           if (filterField && filterField.value != "") {
             FilterPasswords();
           }
+          signonsTree.treeBoxObject.ensureRowIsVisible(signonsTree.view.selection.currentIndex);
           break;
       }
       Services.obs.notifyObservers(null, "passwordmgr-dialog-updated");
     }
   }
 };
 
 // Formatter for localization.
@@ -384,17 +385,16 @@ function DeleteSignon() {
     }
   }
 
   // update selection and/or buttons
   if (table.length) {
     // update selection
     let nextSelection = (selections[0] < table.length) ? selections[0] : table.length - 1;
     tree.view.selection.select(nextSelection);
-    tree.treeBoxObject.ensureRowIsVisible(nextSelection);
   } else {
     // disable buttons
     removeButton.setAttribute("disabled", "true");
     removeAllButton.setAttribute("disabled", "true");
   }
   tree.view.selection.selectEventsSuppressed = false;
   FinalizeSignonDeletions(syncNeeded);
 }