Merge branch 'master' into gh-pages

Conflicts:
	javascripts/app.js
This commit is contained in:
2016-01-29 22:56:24 +08:00
9 changed files with 3157 additions and 33 deletions
+16 -3
View File
@@ -1,13 +1,26 @@
define(
['backbone'
['backbone',
'localforage',
'localforagebackbone'
],
function(
Backbone
Backbone,
localforage,
localforageBackbone
) {
var TaskModel = Backbone.Model.extend({
offlineSync: Backbone.localforage.sync('TaskModel'),
/** switches sync between server and local databases **/
sync: function(){
if (window.hackflowyOffline)
return this.offlineSync.apply(this,arguments);
else
return Backbone.sync.apply(this, arguments);
},
defaults: {
parentId: 0,
content: '',
@@ -25,7 +38,7 @@ Backbone
//REVERT BACK ON ERROR
self.set({'isCompleted':prev_isCompleted});
}
})
});
}
});