summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrion <brion@pobox.com>2009-08-16 10:17:03 -0700
committerCraig Andrews <candrews@integralblue.com>2009-08-16 20:01:56 -0400
commit84227dd4e1f5e776d56c759297605027a5824c57 (patch)
treebb55c8895aa5cc1b554a5b6fc921fa25f08949fc
parent136a69a387719d560f97b6f8ee73d1224b2bac8c (diff)
Use spinner icon while performing AJAX submissions of favorite/unfavorite button so there's some visual feedback that something's happening.
-rw-r--r--js/util.js8
-rw-r--r--theme/default/css/display.css4
2 files changed, 12 insertions, 0 deletions
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');
diff --git a/theme/default/css/display.css b/theme/default/css/display.css
index 646fb0445..6a4b87df1 100644
--- a/theme/default/css/display.css
+++ b/theme/default/css/display.css
@@ -223,6 +223,10 @@ background:transparent url(../../base/images/icons/twotone/green/favourite.gif)
.notice-options form.form_disfavor input.submit {
background:transparent url(../../base/images/icons/twotone/green/disfavourite.gif) no-repeat 0 45%;
}
+.notice-options form.form_favor.processing input.submit,
+.notice-options form.form_disfavor.processing input.submit {
+background:transparent url(../../base/images/icons/icon_processing.gif) no-repeat 0 45%;
+}
.notice-options .notice_delete {
background:transparent url(../../base/images/icons/twotone/green/trash.gif) no-repeat 0 45%;
}