From 6a45bae887084f6d23b8e35f4cda2da401c0200a Mon Sep 17 00:00:00 2001 From: malik masis Date: Mon, 14 Nov 2022 16:46:02 +0300 Subject: [PATCH] Added Hiden-Show button for razor - account --- .../Pages/Account/Login.cshtml | 28 ++++++++++++++++--- .../Pages/Account/Login.js | 22 +++++++++++++++ 2 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.js diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml index ae31edc5e7..2b0fcb9c2c 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml @@ -2,10 +2,26 @@ @using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.Account.Localization @using Volo.Abp.Account.Settings +@using Volo.Abp.Account.Web.Pages.Account; +@using Volo.Abp.AspNetCore.Mvc.UI.Theming; +@using Volo.Abp.Identity; @using Volo.Abp.Settings @model Volo.Abp.Account.Web.Pages.Account.LoginModel @inject IHtmlLocalizer L +@inject IThemeManager ThemeManager @inject Volo.Abp.Settings.ISettingProvider SettingProvider + +@{ + Layout = ThemeManager.CurrentTheme.GetAccountLayout(); +} + +@section scripts + { + + + +} +

@L["Login"]

@@ -21,17 +37,21 @@
- +
+
- - +
+ + +
+
- + @L["ForgotPassword"] diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.js b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.js new file mode 100644 index 0000000000..56934f4fef --- /dev/null +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.js @@ -0,0 +1,22 @@ +$(function () { + $("#PasswordVisibilityButton").click(function (e) { + let button = $(this); + let passwordInput = button.parent().find("input"); + if (!passwordInput) { + return; + } + + if (passwordInput.attr("type") === "password") { + passwordInput.attr("type", "text"); + } + else { + passwordInput.attr("type", "password"); + } + + let icon = button.find("i"); + if (icon) { + icon.toggleClass("fa-eye-slash").toggleClass("fa-eye"); + } + }); + +});