Bug 1251916 - Use standard JavaScript features in toolkit/components/passwordmgr to pass eslint checks: general, simple changes. r=MattN

MozReview-Commit-ID: IdecwypP6on
This commit is contained in:
Sebastian Hengst
2016-02-28 14:10:55 -08:00
parent ca11dee7aa
commit 9b2fcb3de7
19 changed files with 160 additions and 139 deletions

View File

@@ -4,6 +4,8 @@
/*** =================== SAVED SIGNONS CODE =================== ***/
Cu.import("resource://gre/modules/AppConstants.jsm");
var kSignonBundle;
var showingPasswords = false;
var dateFormatter = new Intl.DateTimeFormat(undefined,
@@ -243,11 +245,10 @@ function HandleSignonKeyPress(e) {
if (signonsTree.getAttribute("editing")) {
return;
}
if (e.keyCode == KeyEvent.DOM_VK_DELETE
#ifdef XP_MACOSX
|| e.keyCode == KeyEvent.DOM_VK_BACK_SPACE
#endif
) {
if (e.keyCode == KeyEvent.DOM_VK_DELETE ||
(AppConstants.platform == "macosx" &&
e.keyCode == KeyEvent.DOM_VK_BACK_SPACE))
{
DeleteSignon();
}
}

View File

@@ -87,7 +87,7 @@ function DeleteAllFromTree(tree, view, table, deletedTable, removeButton, remove
table.length = 0;
// clear out selections
view.selection.select(-1);
view.selection.select(-1);
// update the tree view and notify the tree
view.rowCount = 0;

View File

@@ -4,6 +4,8 @@
/*** =================== REJECTED SIGNONS CODE =================== ***/
Components.utils.import("resource://gre/modules/AppConstants.jsm");
function RejectsStartup() {
LoadRejects();
@@ -89,11 +91,10 @@ function FinalizeRejectDeletions() {
}
function HandleRejectKeyPress(e) {
if (e.keyCode == KeyEvent.DOM_VK_DELETE
#ifdef XP_MACOSX
|| e.keyCode == KeyEvent.DOM_VK_BACK_SPACE
#endif
) {
if (e.keyCode == KeyEvent.DOM_VK_DELETE ||
(AppConstants.platform == "macosx" &&
e.keyCode == KeyEvent.DOM_VK_BACK_SPACE))
{
DeleteReject();
}
}