aboutsummaryrefslogtreecommitdiffstats
path: root/www/js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-04-22 11:50:45 +0100
committerStruan Donald <struan@exo.org.uk>2013-04-22 15:56:00 +0100
commitf33f8cb2cf0e030c682a73e0e5df81a14125cceb (patch)
treec75f60386de4d193495f1f974355e9437818d44b /www/js
parent85d67d2d79d01396ffe85d77d8b112874d305360 (diff)
display standard jquery mobile busy spinner when we are making an ajax request
Diffstat (limited to 'www/js')
-rw-r--r--www/js/app.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/www/js/app.js b/www/js/app.js
index a2a937c..ebaf671 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -125,6 +125,9 @@ var tpl = {
document.addEventListener('offline', function() { FMS.offline(); }, true);
document.addEventListener('online', function() { FMS.online(); }, true);
+ $(document).on('ajaxStart', function() { console.log('ajax on'); $.mobile.loading('show'); } );
+ $(document).on('ajaxStop', function() { console.log('ajax off'); $.mobile.loading('hide'); } );
+
FMS.allDrafts.comparator = function(a,b) { var a_date = a.get('created'), b_date = b.get('created'); return a_date === b_date ? 0 : a_date < b_date ? 1 : -1; };
FMS.allDrafts.fetch();
FMS.loadCurrentDraft();