From 30523e3eb7932edf25814d7502bf53650e00e7b6 Mon Sep 17 00:00:00 2001 From: xevidos Date: Wed, 19 Aug 2020 22:40:48 -0400 Subject: [PATCH] Added styles to login form --- login.php | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/login.php b/login.php index ab47899..f4b3d37 100644 --- a/login.php +++ b/login.php @@ -84,14 +84,22 @@ if( isset( $_SESSION['theme'] ) ) { right: 50%; top: 50%; transform: translate( 50%,-50% ); - width: 50%; + width: 25%; + } + + @media only screen and (max-width: 850px) { + + #container { + + width: 50%; + } } @media only screen and (max-width: 650px) { #container { - width: 80%; + width: 75%; } } @@ -127,9 +135,7 @@ if( isset( $_SESSION['theme'] ) ) { init: function() { - let _ = this; - - this.d = { + let d = { username: { @@ -149,23 +155,31 @@ if( isset( $_SESSION['theme'] ) ) { }, }; this.form = new codiad.forms({ - data: _.d, + data: d, container: $( "#container" ), submit_label: "Login", }); - this.form.submit + this.form.submit = this.submit; }, - submit: function() { + submit: async function() { let _this = this; - + let submit = _this.v.controls.find( `[type="submit"]` ); + if( _this.saving ) { return; } _this.saving = true; + submit.attr( "disabled", true ); + submit.text( "Submitting ..." ); + + let data = await _this.m.get_values(); + //let response = await codiad.common.ajax( "./index.php", "POST", data ); + + console.log( data ); submit.attr( "disabled", true ); submit.text( "Logging In ..." );