From ed56099b89ffe1c32120085ec84826f032174d94 Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 29 Aug 2015 14:07:02 -0400 Subject: [PATCH] update login page --- dashboard-ui/scripts/loginpage.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dashboard-ui/scripts/loginpage.js b/dashboard-ui/scripts/loginpage.js index e5333a22a1..7eb2379980 100644 --- a/dashboard-ui/scripts/loginpage.js +++ b/dashboard-ui/scripts/loginpage.js @@ -89,7 +89,7 @@ return "Last seen " + humane_date(lastActivityDate); }, - authenticateUserByName: function (apiClient, username, password) { + authenticateUserByName: function (page, apiClient, username, password) { Dashboard.showLoadingMsg(); @@ -114,9 +114,9 @@ }).fail(function () { - $('#pw', '#loginPage').val(''); - $('#txtManualName', '#loginPage').val(''); - $('#txtManualPassword', '#loginPage').val(''); + $('#pw', page).val(''); + $('#txtManualName', page).val(''); + $('#txtManualPassword', page).val(''); Dashboard.hideLoadingMsg(); @@ -182,7 +182,7 @@ html += ''; } - var elem = $('#divUsers', '#loginPage').html(html); + var elem = $('#divUsers', page).html(html); $('a', elem).on('click', function () { @@ -194,10 +194,10 @@ LoginPage.showManualForm(page, true); } else if (haspw == 'false') { - LoginPage.authenticateUserByName(apiClient, name, ''); + LoginPage.authenticateUserByName(page, apiClient, name, ''); } else { $('#txtManualName', page).val(name); - $('#txtManualPassword', '#loginPage').val(''); + $('#txtManualPassword', page).val(''); LoginPage.showManualForm(page, true, true); } }); @@ -205,8 +205,10 @@ onManualSubmit: function () { + var page = $(this).parents('.page'); + LoginPage.getApiClient().done(function (apiClient) { - LoginPage.authenticateUserByName(apiClient, $('#txtManualName', '#loginPage').val(), $('#txtManualPassword', '#loginPage').val()); + LoginPage.authenticateUserByName(page, apiClient, $('#txtManualName', page).val(), $('#txtManualPassword', page).val()); }); // Disable default form submission