[Pkg-javascript-commits] [backbone] 41/74: Added TodoView.remove()

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 16:59:07 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.3.0
in repository backbone.

commit 315ba7302ac5c0470a2441f9f1d4d568e5263eb5
Author: Will Moffat <wdm at google.com>
Date:   Mon Nov 1 15:32:49 2010 -0700

    Added TodoView.remove()
    
    Called by Todo Model so that the model doesn't have to manipulate the DOM directly.
---
 examples/todos/todos.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/examples/todos/todos.js b/examples/todos/todos.js
index 5819528..0ebd2cb 100644
--- a/examples/todos/todos.js
+++ b/examples/todos/todos.js
@@ -27,10 +27,10 @@ $(function(){
       this.save({done: !this.get("done")});
     },
 
-    // Remove this Todo from *localStorage*, deleting its view.
+    // Remove this Todo from *localStorage* and delete its view.
     clear: function() {
       this.destroy();
-      $(this.view.el).remove();
+      this.view.remove();
     }
 
   });
@@ -143,6 +143,11 @@ $(function(){
       if (e.keyCode == 13) this.close();
     },
 
+    // Remove this view from the DOM
+    remove: function() {
+      $(this.el).remove();
+    },
+
     // Remove the item, destroy the model.
     clear: function() {
       this.model.clear();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list