aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui/condition.reel/condition.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/montage/ui/condition.reel/condition.js')
-rwxr-xr-xnode_modules/montage/ui/condition.reel/condition.js24
1 files changed, 6 insertions, 18 deletions
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
110 enumerable:false 110 enumerable:false
111 }, 111 },
112 112
113 /**
114
115 */
116 // TODO should this strategy be part of another class? 113 // TODO should this strategy be part of another class?
117 // TODO expose the options as an exported enum 114 // TODO expose the options as an exported enum
118 removalStrategy:{ 115 removalStrategy:{
@@ -131,11 +128,7 @@ exports.Condition = Montage.create(Component, /** @lends module:"montage/ui/cond
131 } 128 }
132 }, 129 },
133 130
134 /**
135 131
136 @param
137 @returns
138 */
139 didCreate:{ 132 didCreate:{
140 value:function () { 133 value:function () {
141 this._slot = Slot.create(); 134 this._slot = Slot.create();
@@ -150,19 +143,14 @@ exports.Condition = Montage.create(Component, /** @lends module:"montage/ui/cond
150 prepareForDraw: { 143 prepareForDraw: {
151 enumerable: false, 144 enumerable: false,
152 value: function() { 145 value: function() {
153 146 var i, childList, childElement;
154 if (!this.content) { 147 if (!this.content) {
155 this.content = document.createElement("div"); 148 this.content = document.createElement("div");
156 149 childList = Array.prototype.slice.call(this._element.childNodes, 0);
157 var conditionContentRange = document.createRange(); 150 for (i = 0; (childElement = childList[i]); i++) {
158 conditionContentRange.selectNodeContents(this._element); 151 childElement.parentElement.removeChild(childElement);
159 152 this.content.appendChild(childElement);
160 // TODO not wrap the range if it is a range of a single element 153 }
161 // we want to only deal with single elements when appending and removing;
162 // this keeps us from having to keep track of the range or risk losing
163 // a reference to the elements when they're extracted
164 conditionContentRange.surroundContents(this.content);
165 conditionContentRange.deleteContents(); //remove the contents that are part of the original structure
166 } 154 }
167 155
168 var slotRoot = document.createElement("div"); 156 var slotRoot = document.createElement("div");