mirror of
https://github.com/wassname/HackFlowy.git
synced 2026-10-04 12:10:52 +08:00
method to mark the model complete/ uncomplete
This commit is contained in:
1 parent
efa5af0e3d
commit
c5ac608510
1 file changed
+15
-1
@@ -10,9 +10,23 @@ Backbone
|
||||
|
||||
defaults: {
|
||||
parent_id: '',
|
||||
content: ''
|
||||
content: '',
|
||||
is_completed:'n'
|
||||
},
|
||||
|
||||
toggelCompletedStatus:function(isCompleted){
|
||||
var prev_isCompleted = isCompleted,
|
||||
self = this;
|
||||
this.save({'is_completed':isCompleted},
|
||||
{
|
||||
success:function(){},
|
||||
error:function(){
|
||||
//REVERT BACK ON ERROR
|
||||
self.set({'is_completed':prev_isCompleted});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return TaskModel;
|
||||
|
||||
Reference in new issue
Block a user