From 926546106ef2fb35359278b9f08798310e81d8fa Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sat, 17 Dec 2016 15:45:38 -0800 Subject: add loading indicator to post buttons fixes #42 --- views/new-repost.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'views/new-repost.php') diff --git a/views/new-repost.php b/views/new-repost.php index 354083b..e67ab93 100644 --- a/views/new-repost.php +++ b/views/new-repost.php @@ -1,7 +1,7 @@
-
+
@@ -27,6 +27,7 @@ $(function(){ $("#btn_post").click(function(){ + $("#btn_post").addClass("loading disabled").text("Working..."); $.post("/repost", { url: $("#note_url").val() @@ -37,11 +38,13 @@ $(function(){ $("#test_success").removeClass('hidden'); $("#test_error").addClass('hidden'); $("#post_href").attr("href", response.location); + $("#note_form").addClass('hidden'); window.location = response.location; } else { $("#test_success").addClass('hidden'); $("#test_error").removeClass('hidden'); + $("#btn_post").removeClass("loading disabled").text("Post"); } }); -- cgit v1.2.3