author | ymh <ymh.work@gmail.com> |
Tue, 08 Nov 2016 09:01:53 +0100 | |
changeset 397 | 35c597ce5da4 |
parent 28 | b0b56e0f8c7f |
permissions | -rw-r--r-- |
import Ember from 'ember'; export default Ember.Route.extend({ options: Ember.inject.service(), model(params) { return this.store.findRecord('document', params.doc_id); }, actions: { saveDocument: function(doc) { doc.save(); if(this.get('options').backurl) { window.location.replace(this.get('options').backurl); } else { this.transitionTo('index'); } }, cancelDocument: function(doc) { doc.rollbackAttributes(); doc.reload(); } } });