X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=96c8ad570fb88f66a7eeba97420b8909c8c4aceb;hb=c1bbf1ea049cda1eafec49958dc00c49b4690b33;hp=9ef681203c8ec20a578460ee9c8be8f8d63efe1d;hpb=aca4e03f2e47ba62afa39f6ff04f7831dcfe0728;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 9ef6812..96c8ad5 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -639,6 +639,8 @@ function ajaxifyPost(postElement) { return false; }); $(postElement).find(".create-reply button:submit").click(function() { + button = $(this); + button.attr("disabled", "disabled"); sender = $(this.form).find(":input[name=sender]").val(); inputField = $(this.form).find(":input[name=text]:enabled").get(0); postId = getPostId(this); @@ -655,6 +657,7 @@ function ajaxifyPost(postElement) { } else { alert(error); } + button.removeAttr("disabled"); }); })(sender, postId, text, inputField); return false; @@ -1298,6 +1301,8 @@ $(document).ready(function() { return false; }); $("#sone #update-status").submit(function() { + button = $("button:submit", this); + button.attr("disabled", "disabled"); if ($(this).find(":input.default:enabled").length > 0) { return false; } @@ -1307,6 +1312,7 @@ $(document).ready(function() { if ((data != null) && data.success) { loadNewPost(data.postId, data.sone, data.recipient); } + button.removeAttr("disabled"); }); $(this).find(":input[name=sender]").val(getCurrentSoneId()); $(this).find(":input[name=text]:enabled").val("").blur();