mirror of
https://codeberg.org/scip/digiproof.git
synced 2025-12-17 04:30:59 +01:00
initial commit
This commit is contained in:
27
js/controllers_self.js
Normal file
27
js/controllers_self.js
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
App.SelfController = Ember.ObjectController.extend({
|
||||
isEditing: false,
|
||||
errors: {},
|
||||
|
||||
edit: function() {
|
||||
// prepare order to the actual object, not id
|
||||
this.set('isEditing', true);
|
||||
},
|
||||
|
||||
doneEditing: function() {
|
||||
var validated = this.get('model').validate();
|
||||
if(! validated.valid) {
|
||||
this.set('errors', validated);
|
||||
this.set('isEditing', true);
|
||||
}
|
||||
else {
|
||||
this.set('isEditing', false);
|
||||
this.get('model').get("store").commit();
|
||||
}
|
||||
},
|
||||
|
||||
cancelEditing: function() {
|
||||
this.set('isEditing', false);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user