From 22a66cb6e243a3f1c867b62e3942fd2e828019d9 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 8 Mar 2012 13:56:09 -0800 Subject: integrating v0.7 montage into ninja Signed-off-by: Valerio Virgillito --- .../montage/ui/condition.reel/condition.js | 24 ++++++---------------- 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'node_modules/montage/ui/condition.reel/condition.js') diff --git a/node_modules/montage/ui/condition.reel/condition.js b/node_modules/montage/ui/condition.reel/condition.js index 053adb16..064f51b7 100755 --- a/node_modules/montage/ui/condition.reel/condition.js +++ b/node_modules/montage/ui/condition.reel/condition.js @@ -110,9 +110,6 @@ exports.Condition = Montage.create(Component, /** @lends module:"montage/ui/cond enumerable:false }, - /** - - */ // TODO should this strategy be part of another class? // TODO expose the options as an exported enum removalStrategy:{ @@ -131,11 +128,7 @@ exports.Condition = Montage.create(Component, /** @lends module:"montage/ui/cond } }, - /** - @param - @returns - */ didCreate:{ value:function () { this._slot = Slot.create(); @@ -150,19 +143,14 @@ exports.Condition = Montage.create(Component, /** @lends module:"montage/ui/cond prepareForDraw: { enumerable: false, value: function() { - + var i, childList, childElement; if (!this.content) { this.content = document.createElement("div"); - - var conditionContentRange = document.createRange(); - conditionContentRange.selectNodeContents(this._element); - - // TODO not wrap the range if it is a range of a single element - // we want to only deal with single elements when appending and removing; - // this keeps us from having to keep track of the range or risk losing - // a reference to the elements when they're extracted - conditionContentRange.surroundContents(this.content); - conditionContentRange.deleteContents(); //remove the contents that are part of the original structure + childList = Array.prototype.slice.call(this._element.childNodes, 0); + for (i = 0; (childElement = childList[i]); i++) { + childElement.parentElement.removeChild(childElement); + this.content.appendChild(childElement); + } } var slotRoot = document.createElement("div"); -- cgit v1.2.3