aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/views/home.js
blob: cfa6167a6aae6c55c8272006877bc8306b246113 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
;(function (FMS, Backbone, _, $) {
    _.extend( FMS, {
        HomeView: FMS.FMSView.extend({
            template: 'home',
            tag: 'div',
            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, _, $);