Skip to content

Commit e04d8a6

Browse files
fix: Fix DOMElement#onMount
1 parent 687a98a commit e04d8a6

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

dom-renderables/DOMElement.js

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,41 @@ DOMElement.prototype.onMount = function onMount(node, id) {
163163
this._id = id;
164164
TransformSystem.makeBreakPointAt(node.getLocation());
165165

166-
this.onSizeModeChange.apply(this, node.getSizeMode());
166+
var key;
167+
var val;
168+
var i;
169+
var len;
170+
171+
this._initialized = true;
172+
this._inDraw = true;
173+
174+
this._changeQueue.push(
175+
Commands.INIT_DOM,
176+
this.value.tagName
177+
);
178+
179+
for (key in this.value.classes)
180+
if (this.value.classes[key])
181+
this.addClass(key);
182+
183+
for (key in this.value.properties) {
184+
val = this.value.properties[key];
185+
if (val)
186+
this.setProperty(key, val);
187+
}
188+
189+
for (key in this.value.attributes) {
190+
val = this.value.attributes[key];
191+
if (val)
192+
this.setAttribute(key, val);
193+
}
194+
195+
if (this.value.content)
196+
this.setContent(this.value.content);
197+
198+
var uiEvents = node.getUIEvents();
199+
for (i = 0, len = uiEvents.length; i < len; i++)
200+
this.onAddUIEvent(uiEvents[i]);
167201

168202
this.setAttribute('data-fa-path', node.getLocation());
169203
this.setProperty('display', 'block');

0 commit comments

Comments
 (0)