aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/views/sent.js
blob: d146db6ad3089bd679445b385c705453e8bd4e45 (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
(function (FMS, Backbone, _, $) {
    _.extend( FMS, {
        SentView: FMS.FMSView.extend({
            template: 'sent',
            id: 'sent-page',
            prev: 'around',

            events: {
                'pagehide': 'destroy',
                'pagebeforeshow': 'beforeDisplay',
                'pageshow': 'afterDisplay',
                'vclick .ui-btn-left': 'onClickButtonPrev',
                'vclick #rate_app': 'onClickRateApp'
            },

            render: function(){
                if ( !this.template ) {
                    console.log('no template to render');
                    return;
                }
                template = _.template( tpl.get( this.template ) );
                this.$el.html(template(FMS.createdReport.toJSON()));
                this.afterRender();
                return this;
            },

            onClickRateApp: function(e) {
                e.preventDefault();
                var el = $('#rate_app');
                var href = el.attr('href');
                window.open(href, '_system');
                return false;
            }
        })
    });
})(FMS, Backbone, _, $);