From 86eedb90435c4382a4e956b36b6cdf4eb76bf742 Mon Sep 17 00:00:00 2001 From: Andre D Date: Mon, 13 May 2013 13:38:22 -0700 Subject: [PATCH] wiki: Disable save button during wiki page edit saving. --- r2/r2/public/static/js/wiki.js | 4 ++++ r2/r2/templates/wikieditpage.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/r2/r2/public/static/js/wiki.js b/r2/r2/public/static/js/wiki.js index 2c22054b4..27fc06c50 100644 --- a/r2/r2/public/static/js/wiki.js +++ b/r2/r2/public/static/js/wiki.js @@ -89,11 +89,15 @@ r.wiki = { conflict.hide() special.hide() params = r.utils.serializeForm($this) + $('#wiki_save_button').attr("disabled", true) r.wiki.request({ url: url, type: 'POST', dataType: 'json', data: params, + error: function() { + $('#wiki_save_button').removeAttr("disabled") + }, success: function() { window.location = r.wiki.baseUrl() + '/' + r.config.wiki_page }, diff --git a/r2/r2/templates/wikieditpage.html b/r2/r2/templates/wikieditpage.html index 3f2c4fa1d..5e647bc29 100644 --- a/r2/r2/templates/wikieditpage.html +++ b/r2/r2/templates/wikieditpage.html @@ -44,5 +44,5 @@
-

+