diff options
Diffstat (limited to 'modules/tag/js')
| -rw-r--r-- | modules/tag/js/tag.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js index 74e48998..92f585a5 100644 --- a/modules/tag/js/tag.js +++ b/modules/tag/js/tag.js @@ -3,16 +3,17 @@ $("document").ready(function() { }); function ajaxify_tag_form() { - $("#gAddTagForm").ajaxForm({ - complete: function(xhr, statusText) { - $("#gAddTagForm").replaceWith(xhr.responseText); - if (xhr.status == 201) { + $("#gTag form").ajaxForm({ + dataType: "json", + success: function(data) { + $("#gTag form").replaceWith(data.form); + ajaxify_tag_form(); + if (data.result == "success") { $.get($("#gTagCloud").attr("src"), function(data, textStatus) { $("#gTagCloud").html(data); }); - $("#gAddTagForm").clearForm(); } - ajaxify_tag_form(); + $("#gTag form").clearForm(); } }); } |
