on master help sign in
Fix issue #230
984cfc5Evan Czaplicki
runtime/Render/Element.js+4−12
@@ -124,6 +124,8 @@ function toPos(pos) {
124 }
124 }
125}
125}
126
126
127+// must clear right, left, top, bottom, and transform
128+// before calling this function
127function setPos(pos,w,h,e) {
129function setPos(pos,w,h,e) {
128 e.style.position = 'absolute';
130 e.style.position = 'absolute';
129 e.style.margin = 'auto';
131 e.style.margin = 'auto';
@@ -220,18 +222,8 @@ function update(node, curr, next) {
220 }
222 }
221 break;
223 break;
222 case "Container":
224 case "Container":
223− var inner = node.firstChild;
224− if (!update(inner, currE._1, nextE._1)) {
225+ update(node.firstChild, currE._1, nextE._1)
225− if (nextE._0.horizontal.ctor !== currE._0.horizontal.ctor) {
226− inner.style.left = inner.style.right = 'none';
227− removeTransform(inner.style);
228− }
229− if (nextE._0.vertical.ctor !== currE._0.vertical.ctor) {
230− inner.style.top = inner.style.bottom = 'none';
231− removeTransform(inner.style);
232− }
233− }
234− setPos(nextE._0, nextE._1.props.width, nextE._1.props.height, inner);
226+ setPos(nextE._0, nextE._1.props.width, nextE._1.props.height, node.firstChild);
235 break;
227 break;
236 case "Custom":
228 case "Custom":
237 if (currE.type === nextE.type) {
229 if (currE.type === nextE.type) {