Skip to content

Commit

Permalink
Implemented clone for VirtualElement.
Browse files Browse the repository at this point in the history
Will be necessary to clone the _template for #126.
  • Loading branch information
Kanaye committed Jan 23, 2017
1 parent d39d6e8 commit 4358bfb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/query/VirtualElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,16 @@ define([
domQuery.popContext();
},

clone: function () {
var element = this._el;
this._el = null;
this.clone = null;
var clone = blocks.clone(this, true);
clone.clone = this.clone = VirtualElement.prototype.clone;
this._el = element;
return clone;
},

_length: function () {
var template = this._template;
var index = -1;
Expand Down

0 comments on commit 4358bfb

Please sign in to comment.