From 06970f2db91d684b214b4dd6a4711d404aadfd8b Mon Sep 17 00:00:00 2001 From: Jan Monschke Date: Fri, 22 Jul 2011 02:25:50 +0200 Subject: [PATCH] added remote-delete example to the chat --- backbone-couchdb.coffee | 4 +-- chat_example/_attachments/index.html | 2 +- chat_example/_attachments/js/app.js | 36 +++++++++++++++++------- chat_example/_attachments/style/main.css | 12 ++++++++ chat_example/filters/messages.js | 3 +- 5 files changed, 43 insertions(+), 14 deletions(-) diff --git a/backbone-couchdb.coffee b/backbone-couchdb.coffee index e9acc85..dc74ae0 100644 --- a/backbone-couchdb.coffee +++ b/backbone-couchdb.coffee @@ -120,7 +120,7 @@ class Backbone.Collection extends Backbone.Collection # Manually start listening to real time updates listen_to_changes : -> # don't enable changes feed a second time - unless @_db_changes_enabled + unless @_db_changes_enabled @_db_changes_enabled = true @_db_inst = con.helpers.make_db() unless @_db_inst @_db_inst.info @@ -151,7 +151,7 @@ class Backbone.Collection extends Backbone.Collection if obj? # remove from collection if doc has been deleted on the server if _doc.deleted - @remove obj + @remove obj else # set new values if _revs are not the same obj.set _doc.doc unless obj.get("_rev") == _doc.doc._rev diff --git a/chat_example/_attachments/index.html b/chat_example/_attachments/index.html index 21d4e7a..4364942 100644 --- a/chat_example/_attachments/index.html +++ b/chat_example/_attachments/index.html @@ -24,7 +24,7 @@