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
|
(function (FMS, Backbone, _, $) {
_.extend( FMS, {
ExistingView: FMS.FMSView.extend({
template: 'existing',
id: 'existing',
events: {
'pagehide': 'destroy',
'pageshow': 'afterDisplay',
'click #use_report': 'useReport',
'click #discard': 'discardReport'
},
useReport: function() {
localStorage.currentDraftID = FMS.currentDraft.id;
this.navigate('around');
},
discardReport: function() {
FMS.currentDraft.destroy();
FMS.currentDraft = new FMS.Draft();
this.navigate('around');
}
})
});
})(FMS, Backbone, _, $);
|