aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2013-01-12 06:11:46 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2013-01-12 06:13:28 +0100
commitd2434633a7f76efc7c6e633a631ae2b40575deff (patch)
treecbd047693b437780b5ad852fd9b207b9519e48ad
parentClean up null titles, wav, and unicode. (diff)
downloadzmusic-ng-d2434633a7f76efc7c6e633a631ae2b40575deff.tar.xz
zmusic-ng-d2434633a7f76efc7c6e633a631ae2b40575deff.zip
Prettify login buttons.
-rw-r--r--frontend/js/app.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/frontend/js/app.js b/frontend/js/app.js
index 6f58a0a..d7f674c 100644
--- a/frontend/js/app.js
+++ b/frontend/js/app.js
@@ -51,17 +51,16 @@ $(function() {
login.find("form").submit(function() {
var username = $(this.username).val();
var password = $(this.password).val();
- var button = login.find("button").removeClass("btn-primary");
- login.find("input").val("").removeClass("incorrect-login");
+ var button = login.find("button").removeClass("btn-primary").addClass("disabled");
+ login.find("input").val("").removeClass("incorrect-login").attr("disabled", "disabled");
$.ajax("login", { type: "POST", data: { "username": username, "password": password } }).success(function(response) {
if (response.loggedin) {
button.addClass("btn-success");
login.fadeOut();
startApp();
} else {
- login.find("input").first().focus();
- login.find("input").val("").addClass("incorrect-login");
- button.addClass("btn-danger");
+ login.find("input").removeAttr("disabled").val("").addClass("incorrect-login").first().focus();
+ button.addClass("btn-danger").removeClass("disabled");
}
});
return false;