diff --git a/examples/javascript-es5/src/controller.js b/examples/javascript-es5/src/controller.js index 229b19dde9..8612f42789 100644 --- a/examples/javascript-es5/src/controller.js +++ b/examples/javascript-es5/src/controller.js @@ -151,9 +151,9 @@ var self = this; self.model.remove(id, function () { self.view.render("removeItem", id); - }); - self._filter(); + self._filter(); + }); }; /** @@ -165,9 +165,9 @@ data.forEach(function (item) { self.removeItem(item.id); }); - }); - self._filter(); + self._filter(); + }); }; /** @@ -186,10 +186,10 @@ id: id, completed: completed, }); - }); - if (!silent) - self._filter(); + if (!silent) + self._filter(); + }); }; /** @@ -202,9 +202,9 @@ data.forEach(function (item) { self.toggleComplete(item.id, completed, true); }); - }); - self._filter(); + self._filter(); + }); }; /** diff --git a/examples/javascript-es5/src/model.js b/examples/javascript-es5/src/model.js index 2268fe8539..1fb69948f9 100644 --- a/examples/javascript-es5/src/model.js +++ b/examples/javascript-es5/src/model.js @@ -78,7 +78,7 @@ * @param {function} callback The callback to fire when the removal is complete. */ Model.prototype.remove = function (id, callback) { - this.storage.remove(id, callback); + return this.storage.remove(id, callback); }; /**