From 87d340e525663846c66c22d78252ca87e016ec66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 20 May 2011 08:50:09 +0100 Subject: [PATCH] Introduce private Item#_clone(copy), so subclasses can override the way the copy is actually produced, e.g. providing parameters to the constructor. --- src/item/Item.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/item/Item.js b/src/item/Item.js index 0e277431..6fcb4108 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -30,7 +30,10 @@ var Item = this.Item = Base.extend({ * @return the newly cloned item */ clone: function() { - var copy = new this.constructor(); + return this._clone(new this.constructor()); + }, + + _clone: function(copy) { // Copy over style copy.setStyle(this._style); // If this item has children, clone and append each of them: