diff options
Diffstat (limited to 'www/js/views/sent.js')
-rw-r--r-- | www/js/views/sent.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/www/js/views/sent.js b/www/js/views/sent.js new file mode 100644 index 0000000..f25a178 --- /dev/null +++ b/www/js/views/sent.js @@ -0,0 +1,44 @@ +(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 #id_report_another': 'onClickButtonPrev', + 'vclick #open_report': 'onClickOpenReport', + 'vclick #rate_app': 'onClickRateApp' + }, + + render: function(){ + if ( !this.template ) { + FMS.printDebug('no template to render'); + return; + } + template = _.template( tpl.get( this.template ) ); + this.$el.html(template(FMS.createdReport.toJSON())); + this.afterRender(); + return this; + }, + + onClickOpenReport: function(e) { + e.preventDefault(); + window.open(FMS.createdReport.get('site_url'), '_system'); + return false; + }, + + onClickRateApp: function(e) { + e.preventDefault(); + var el = $('#rate_app'); + var href = el.attr('href'); + window.open(href, '_system'); + return false; + } + }) + }); +})(FMS, Backbone, _, $); |