aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/views
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/views')
-rw-r--r--www/js/views/around.js18
-rw-r--r--www/js/views/fms.js4
-rw-r--r--www/js/views/home.js31
3 files changed, 52 insertions, 1 deletions
diff --git a/www/js/views/around.js b/www/js/views/around.js
new file mode 100644
index 0000000..ba0e62e
--- /dev/null
+++ b/www/js/views/around.js
@@ -0,0 +1,18 @@
+;(function (FMS, Backbone, _, $) {
+ _.extend( FMS, {
+ AroundView: FMS.FMSView.extend({
+ template: 'around',
+ tag: 'div',
+ id: 'around-page',
+
+ afterDisplay: function() {
+ console.log( 'around after display');
+ fixmystreet.latitude = 56.33182;
+ fixmystreet.longitude = -2.79483;
+
+ show_map();
+ console.log('map shown');
+ }
+ })
+ });
+})(FMS, Backbone, _, $);
diff --git a/www/js/views/fms.js b/www/js/views/fms.js
index 45eeabf..d827445 100644
--- a/www/js/views/fms.js
+++ b/www/js/views/fms.js
@@ -19,6 +19,8 @@
afterRender: function() {},
+ afterDisplay: function() {},
+
onClickButtonPrev: function() {
this.navigate( this.prev, 'right' );
},
@@ -26,6 +28,8 @@
onClickButtonNext: function() {
this.navigate( this.next, 'left' );
},
+
+ destroy: function() { console.log('destory for ' + this.id); this.remove(); }
})
});
})(FMS, Backbone, _, $);
diff --git a/www/js/views/home.js b/www/js/views/home.js
index 644754d..cfa6167 100644
--- a/www/js/views/home.js
+++ b/www/js/views/home.js
@@ -3,7 +3,36 @@
HomeView: FMS.FMSView.extend({
template: 'home',
tag: 'div',
- id: 'front-page'
+ 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() {
+ if ( navigator && navigator.network && ( navigator.network.connection.type == Connection.NONE ||
+ navigator.network.connection.type == Connection.UNKNOWN ) ) {
+ localStorage.offline = 1;
+ FMS.router.navigate( 'no_connection' );
+ } else {
+ alert('pause');
+ FMS.router.navigate( 'around', { trigger: true } );
+ }
+ }
})
});
})(FMS, Backbone, _, $);