]> git.za3k.com Git - flowy.git/commitdiff
Fix toggling parents breaking children jquery event handlers
authorZachary Vance <vanceza@gmail.com>
Thu, 19 Mar 2015 23:25:20 +0000 (16:25 -0700)
committerZachary Vance <vanceza@gmail.com>
Thu, 19 Mar 2015 23:25:20 +0000 (16:25 -0700)
dist/flowy.js
src/models/test.js

index 052a922eaf5503a0b13711c4f10ffcd050642e11..bf6b3a3663fd56abf421e7dd1dccaa1a2401e1cb 100644 (file)
@@ -136,7 +136,7 @@ var TodoView = Backbone.View.extend({
      return this;
   },
   render: function() {
-    var oldChildren = this.$el.find("> .bullets > *");
+    var oldChildren = this.$el.find("> .bullets > *").detach(); // detach keeps handlers
     this.$el.html(Mustache.to_html(this.template, this.model.toJSON())); // Should hopefully be model.attributes
     this.$el.toggleClass('completed', this.model.get('completed'));
     this.$el.toggleClass('collapsed', this.model.get('collapsed'));
index 052a922eaf5503a0b13711c4f10ffcd050642e11..bf6b3a3663fd56abf421e7dd1dccaa1a2401e1cb 100644 (file)
@@ -136,7 +136,7 @@ var TodoView = Backbone.View.extend({
      return this;
   },
   render: function() {
-    var oldChildren = this.$el.find("> .bullets > *");
+    var oldChildren = this.$el.find("> .bullets > *").detach(); // detach keeps handlers
     this.$el.html(Mustache.to_html(this.template, this.model.toJSON())); // Should hopefully be model.attributes
     this.$el.toggleClass('completed', this.model.get('completed'));
     this.$el.toggleClass('collapsed', this.model.get('collapsed'));