From 84227dd4e1f5e776d56c759297605027a5824c57 Mon Sep 17 00:00:00 2001 From: brion Date: Sun, 16 Aug 2009 10:17:03 -0700 Subject: Use spinner icon while performing AJAX submissions of favorite/unfavorite button so there's some visual feedback that something's happening. --- js/util.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'js') diff --git a/js/util.js b/js/util.js index e5f117df0..f09ce838c 100644 --- a/js/util.js +++ b/js/util.js @@ -82,6 +82,10 @@ $(document).ready(function(){ // XXX: refactor this code var favoptions = { dataType: 'xml', + beforeSubmit: function(data, target, options) { + $(target).addClass('processing'); + return true; + }, success: function(xml) { var new_form = document._importNode($('form', xml).get(0), true); var dis = new_form.id; var fav = dis.replace('disfavor', 'favor'); @@ -91,6 +95,10 @@ $(document).ready(function(){ }; var disoptions = { dataType: 'xml', + beforeSubmit: function(data, target, options) { + $(target).addClass('processing'); + return true; + }, success: function(xml) { var new_form = document._importNode($('form', xml).get(0), true); var fav = new_form.id; var dis = fav.replace('favor', 'disfavor'); -- cgit v1.2.3-54-g00ecf