Bug 234973 - Make selected row visible after removing/editing entries in password manager. r?dolske draft
authorAshhar Hasan <hashhar_dev@outlook.com>
Mon, 13 Mar 2017 03:26:58 +0530
changeset 501174 b612c652193a
parent 497206 f9362554866b
child 549789 364057adaa2b
push id49883
push userbmo:hashhar_dev@outlook.com
push dateSat, 18 Mar 2017 18:04:49 +0000
reviewersdolske
bugs234973
milestone55.0a1
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", null);
     }
   }
 };
 
 // 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);
 }