DynamicNode.prototype.remove = function() {
this.clear();
return this.anchor.parentNode.removeChild(this.anchor); // This line crashes because this.anchor.parentNode is undefined
};
Adding the check
if (!this.anchor.parentNode) return this.anchor;
as the first line of the function works, but I am not sure what the root cause is yet....
How to replicate this issue
parent = """
div
button[event:click=close] "Toggle"
- if @show
- in @details
p "I am the ginger bread man catch me if you can " @name
"""
Serenade.view 'parent', parent
Controller = ->
close: (model, element, event) -> model.set 'show', !!!model.get('show')
model = new Serenade.Model
show: true
details:
name: 'haha'
Serenade.controller 'parent', Controller
document.body.appendChild Serenade.render 'parent', model
I wonder if this issue is same as the one that I talked about in google groups, there is a thread "How do I null properties of Serenade object in a correct way?" Jul 18th describing an alike problem.
Adding the check
as the first line of the function works, but I am not sure what the root cause is yet....
How to replicate this issue