Skip to content

Commit a98f017

Browse files
fix(positions): defer positioning to openIcon and dialog box
1 parent 0774390 commit a98f017

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

dist/aframe-dialog-popup-component.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ AFRAME.registerComponent('dialog-popup', {
232232
if (this.dialogPlaneEl) {
233233
this.positionDialogPlane();
234234
this.dialogPlaneEl.setAttribute('visible', this.isOpen);
235+
this.openIconEl.setAttribute('visible', !this.isOpen);
235236
}
236237
},
237238

@@ -246,7 +247,7 @@ AFRAME.registerComponent('dialog-popup', {
246247
openOn = _this$data.openOn;
247248
var openIcon = document.createElement('a-entity');
248249
openIcon.setAttribute('id', "".concat(this.el.getAttribute('id'), "--open-icon"));
249-
openIcon.setAttribute('position', this.el.getAttribute('position'));
250+
openIcon.setAttribute('position', Object.assign({}, this.el.getAttribute('position')));
250251
openIcon.setAttribute('geometry', {
251252
primitive: 'circle',
252253
radius: radius
@@ -417,6 +418,7 @@ AFRAME.registerComponent('dialog-popup', {
417418
color = _this$data6.dialogBoxColor;
418419
var plane = this.dialogPlaneEl || document.createElement('a-entity');
419420
plane.setAttribute('id', "".concat(this.el.getAttribute('id'), "--dialog-plane"));
421+
plane.setAttribute('position', Object.assign({}, this.el.getAttribute('position')));
420422
plane.setAttribute('visible', false);
421423
plane.setAttribute('geometry', {
422424
primitive: 'plane',
@@ -447,6 +449,7 @@ AFRAME.registerComponent('dialog-popup', {
447449
spawnEntities: function spawnEntities() {
448450
this.el.appendChild(this.generateOpenIcon());
449451
this.el.appendChild(this.generateDialogPlane());
452+
this.el.removeAttribute('position');
450453
}
451454
});
452455

0 commit comments

Comments
 (0)