aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/views/home.js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2014-10-03 15:07:08 +0100
committerDave Arter <davea@mysociety.org>2015-08-28 14:27:15 +0100
commita69d425c0e5c004145ac1ab70e2f7f9fc329b54c (patch)
tree8eb7ff0ff7aaa0fce8bc7214ec6e15b694fddbdc /www/js/views/home.js
parent8fd15b58733c51d7f001f9eac66b7d03830ec0b4 (diff)
update Android to Cordova 3.6
Required due to security issue Remove Android directory as no longer required, move src -> www to match standard layout, update .gitignore to avoid including the standard platform files, update README based on Steve's zurich one
Diffstat (limited to 'www/js/views/home.js')
-rw-r--r--www/js/views/home.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/www/js/views/home.js b/www/js/views/home.js
new file mode 100644
index 0000000..998af1c
--- /dev/null
+++ b/www/js/views/home.js
@@ -0,0 +1,40 @@
+(function (FMS, Backbone, _, $) {
+ _.extend( FMS, {
+ HomeView: FMS.FMSView.extend({
+ template: 'home',
+ id: 'front-page',
+
+ afterRender: function() {
+ /*
+ if ( !can_geolocate && ( !navigator.network || !navigator.network.connection ) ) {
+ geocheck_count++;
+ window.setTimeout( decide_front_page, 1000 );
+ return;
+ }
+
+ // sometime onDeviceReady does not fire so set this here to be sure
+ can_geolocate = true;
+
+ geocheck_count = 0;
+ */
+
+ $('#locating').show();
+
+ },
+
+ afterDisplay: function() {
+ $('#load-screen').hide();
+ if ( FMS.isOffline ) {
+ this.navigate( 'offline' );
+ } else if ( FMS.currentDraft && (
+ FMS.currentDraft.get('title') || FMS.currentDraft.get('lat') ||
+ FMS.currentDraft.get('details') || FMS.currentDraft.get('file') )
+ ) {
+ this.navigate( 'existing' );
+ } else {
+ this.navigate( 'around' );
+ }
+ }
+ })
+ });
+})(FMS, Backbone, _, $);