Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
cleanup after Node.unbind removed
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelw committed Mar 17, 2014
1 parent 33b58e1 commit e843e74
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/TemplateBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,13 @@
if (oneTime)
return;

this.unbind('ref');
return this.bindings.ref = value;
if (!this.bindings_) {
this.bindings_ = { ref: value };
} else {
this.bindings_.ref = value;
}

return value;
},

processBindingDirectives_: function(directives) {
Expand All @@ -487,16 +492,13 @@
if (this.iterator_) {
this.iterator_.close();
this.iterator_ = undefined;
this.bindings.iterator = undefined;
}

return;
}

if (!this.iterator_) {
this.iterator_ = new TemplateIterator(this);
this.bindings = this.bindings || {};
this.bindings.iterator = this.iterator_;
}

this.iterator_.updateDependencies(directives, this.model_);
Expand Down Expand Up @@ -593,9 +595,8 @@
clear: function() {
this.model_ = undefined;
this.delegate_ = undefined;
if (this.bindings && this.bindings.ref)
this.bindings.ref.close()
this.bindings = undefined;
if (this.bindings_ && this.bindings_.ref)
this.bindings_.ref.close()
this.refContent_ = undefined;
if (!this.iterator_)
return;
Expand Down

0 comments on commit e843e74

Please sign in to comment.