Added some type declarations

canary
WolverinDEV 2018-05-05 15:14:47 +02:00
parent d404395eb0
commit 4f0f124949
2 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,7 @@ function submitLogin(user, pass) {
user: user,
pass: pass
},
success: function (result) {
success: (result) => {
setTimeout(() => {
let data;
try {

View File

@ -5,10 +5,10 @@ btn_login.on('click', () => {
.prop("disabled", true)
.empty()
.append($(document.createElement("i")).addClass("fa fa-circle-o-notch fa-spin"));
submitLogin($("#user").val(), $("#pass").val());
submitLogin($("#user").val() as string, $("#pass").val() as string);
});
function submitLogin(user, pass) {
function submitLogin(user: string, pass: string) {
$.ajax({
url: "auth.php?type=login",
type: "POST",
@ -17,7 +17,7 @@ function submitLogin(user, pass) {
user: user,
pass: pass
},
success: function(result){
success: (result: string) => {
setTimeout(() => {
let data;
try {
@ -53,7 +53,7 @@ function submitLogin(user, pass) {
});
}
function loginFailed(err = "") {
function loginFailed(err: string = "") {
btn_login
.prop("disabled", false)
.empty()