4
|
1 |
import Ember from 'ember'; |
|
2 |
|
|
3 |
export default Ember.Route.extend({ |
28
|
4 |
options: Ember.inject.service(), |
4
|
5 |
model(params) { |
|
6 |
return this.store.findRecord('document', params.doc_id); |
|
7 |
}, |
28
|
8 |
actions: { |
|
9 |
saveDocument: function(doc) { |
|
10 |
doc.save(); |
|
11 |
if(this.get('options').backurl) { |
|
12 |
window.location.replace(this.get('options').backurl); |
|
13 |
} |
|
14 |
else { |
|
15 |
this.transitionTo('index'); |
|
16 |
} |
|
17 |
}, |
|
18 |
cancelDocument: function(doc) { |
|
19 |
doc.rollbackAttributes(); |
|
20 |
doc.reload(); |
|
21 |
} |
|
22 |
} |
4
|
23 |
}); |