Commit afa8269f authored by Brandon Satrom's avatar Brandon Satrom

remove autoSync to prevent edit field propagation

parent 566d0d58
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</section> </section>
<div id="info"> <div id="info">
<p>Double-click to edit a todo</p> <p>Double-click to edit a todo</p>
<p>Credits <a href="https://github.com/bsatrom">Brandon Satrom</a>, <a href="https://github.com/burkeholland">Burke Holland</a> &nbsp; <a href="https://github.com/akorchev">Atanas Korchev</a></p> <p>Credits <a href="https://github.com/bsatrom">Brandon Satrom</a>, <a href="https://github.com/burkeholland">Burke Holland</a> &amp; <a href="https://github.com/akorchev">Atanas Korchev</a></p>
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p> <p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</div> </div>
<script type="text/template" id="item-template"> <script type="text/template" id="item-template">
......
...@@ -43,7 +43,6 @@ var app = app || {}; ...@@ -43,7 +43,6 @@ var app = app || {};
// Implementation in js/lib/kendo.data.localstoragedatasource.ds // Implementation in js/lib/kendo.data.localstoragedatasource.ds
app.todoData = new kendo.data.extensions.LocalStorageDataSource({ app.todoData = new kendo.data.extensions.LocalStorageDataSource({
itemBase: 'todos-kendo', itemBase: 'todos-kendo',
autoSync: true,
schema: { schema: {
model: app.Todo model: app.Todo
} }
...@@ -77,6 +76,7 @@ var app = app || {}; ...@@ -77,6 +76,7 @@ var app = app || {};
}); });
todos.add(todo); todos.add(todo);
todos.sync();
newTodo.val(''); newTodo.val('');
}, },
toggleAll: function () { toggleAll: function () {
...@@ -106,14 +106,17 @@ var app = app || {}; ...@@ -106,14 +106,17 @@ var app = app || {};
} }
editData.set('edit', false); editData.set('edit', false);
this.todos.sync();
}, },
destroy: function (e) { destroy: function (e) {
this.todos.remove(e.data); this.todos.remove(e.data);
this.todos.sync();
}, },
destroyCompleted: function () { destroyCompleted: function () {
$.each(this.completedTodos(), function (index, value) { $.each(this.completedTodos(), function (index, value) {
this.todos.remove(value); this.todos.remove(value);
}.bind(this)); }.bind(this));
this.todos.sync();
}, },
// Methods for retrieving filtered todos and count values // Methods for retrieving filtered todos and count values
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment