changeset 427:85d7b62d5c17

Added a global method to change the cursor to an hourglass when an AJAX request fires.
author Brian Neal <bgneal@gmail.com>
date Tue, 26 Apr 2011 02:11:00 +0000
parents c8148cf11a79
children 77b3b01843b5
files gpp/shoutbox/static/js/shoutbox.js static/css/base.css
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gpp/shoutbox/static/js/shoutbox.js	Tue Apr 26 01:04:38 2011 +0000
+++ b/gpp/shoutbox/static/js/shoutbox.js	Tue Apr 26 02:11:00 2011 +0000
@@ -23,6 +23,12 @@
        }
    });
 
+   $("html").bind("ajaxStart", function() {
+      $(this).addClass('busy');
+   }).bind("ajaxStop", function() {
+      $(this).removeClass('busy');
+   });
+
    var numShouts = $('#shoutbox-shout-container > p').size(); 
    var sbBox = $('#shoutbox-shout-container');
 
--- a/static/css/base.css	Tue Apr 26 01:04:38 2011 +0000
+++ b/static/css/base.css	Tue Apr 26 02:11:00 2011 +0000
@@ -443,3 +443,6 @@
 .middle {
    vertical-align: middle;
 }
+html.busy, html.busy * {
+  cursor: wait !important;
+}