From 4927e38eb8f108d4e910e691f593bca4992fb28f Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 18 Apr 2013 11:48:52 +0100 Subject: handle offline/online event and set flag to indicate current state, also set this on init --- www/js/views/home.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'www/js/views/home.js') diff --git a/www/js/views/home.js b/www/js/views/home.js index 383275e..dd908f0 100644 --- a/www/js/views/home.js +++ b/www/js/views/home.js @@ -23,9 +23,7 @@ }, afterDisplay: function() { - if ( navigator && navigator.connection && ( navigator.connection.type == Connection.NONE || - navigator.connection.type == Connection.UNKNOWN ) ) { - localStorage.offline = 1; + if ( FMS.isOffline ) { this.navigate( 'offline' ); } else if ( FMS.currentDraft && ( FMS.currentDraft.get('title') || FMS.currentDraft.get('lat') || -- cgit v1.2.3