Skip to content

Commit cc4b343

Browse files
committed
Merge pull request #37 from GooTechnologies/fix-html
Fix style updates in the html handler.
2 parents 761ecff + 7ed55e5 commit cc4b343

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/goo/loaders/handlers/HtmlComponentHandler.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,15 @@ HtmlComponentHandler.prototype._updateAttributes = function (domElement, entity,
258258
domElement.prevAttributes = config.attributes;
259259

260260
// Set default styles if no style was set by the user.
261-
var style = 'position: absolute; z-index: 1;';
262-
if (!newAttributes.style && config.useTransformComponent === true) {
263-
style += ' top: 0; left: 0; z-index: 1; display: block;';
261+
if (!newAttributes.style) {
262+
var style = 'position: absolute; z-index: 1;';
263+
264+
if (config.useTransformComponent !== true) {
265+
style += ' top: 0; left: 0; display: block;';
266+
}
267+
268+
domElement.setAttribute('style', style);
264269
}
265-
domElement.setAttribute('style', style);
266270

267271
// Force the HTML system to update again.
268272
entity._world.getSystem('HtmlSystem').clearStyleCache(domElement);

0 commit comments

Comments
 (0)