mirror of
https://github.com/wassname/HackFlowy.git
synced 2026-06-27 16:00:04 +08:00
moved index.html
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
define(
|
||||
['backbone'
|
||||
],
|
||||
|
||||
function(
|
||||
Backbone
|
||||
) {
|
||||
|
||||
var TaskModel = Backbone.Model.extend({
|
||||
|
||||
defaults: {
|
||||
parentId: 0,
|
||||
content: '',
|
||||
isCompleted: 0,
|
||||
priority: 0
|
||||
},
|
||||
|
||||
toggelCompletedStatus:function(isCompleted){
|
||||
var prev_isCompleted = isCompleted,
|
||||
self = this;
|
||||
this.save({'isCompleted':isCompleted},
|
||||
{
|
||||
success:function(){},
|
||||
error:function(){
|
||||
//REVERT BACK ON ERROR
|
||||
self.set({'isCompleted':prev_isCompleted});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return TaskModel;
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user