Skip to content

Commit 905a776

Browse files
feat(dialog): make dialog entities children of the parent
1 parent 6f6c98f commit 905a776

File tree

3 files changed

+11
-20
lines changed

3 files changed

+11
-20
lines changed

examples/advanced/index.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,11 @@
99
</head>
1010
<body>
1111
<a-scene inspector="url: https://aframe.io/releases/0.3.0/aframe-inspector.min.js">
12-
<a-camera
13-
id="camera"
14-
wasd-controls-enabled="false"
15-
cursor="rayOrigin: mouse"
16-
/>
17-
<a-sky color="#24CAFF" />
12+
<a-camera id="camera" wasd-controls-enabled="false" cursor="rayOrigin: mouse"></a-camera>
13+
<a-sky color="#24CAFF"></a-sky>
1814
<a-entity
1915
id="dialog"
20-
position="0 0 -4"
16+
position="0 0 -2"
2117
dialog-popup="
2218
openIconImage: ../assets/info.jpg;
2319
closeIconImage: ../assets/close.jpg;
@@ -31,7 +27,7 @@
3127
bodyColor: #603300;
3228
dialogBoxHeight: 3.5;
3329
dialogBoxColor: #964f00;
34-
"/>
30+
"></a-entity>
3531
</a-scene>
3632

3733
<!-- GitHub Corner. -->

examples/basic/index.html

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,17 @@
99
</head>
1010
<body>
1111
<a-scene inspector="url: https://aframe.io/releases/0.3.0/aframe-inspector.min.js">
12-
<a-camera
13-
id="camera"
14-
wasd-controls-enabled="false"
15-
cursor="rayOrigin: mouse"
16-
/>
17-
<a-sky color="#24CAFF" />
12+
<a-camera id="camera" wasd-controls-enabled="false" cursor="rayOrigin: mouse"></a-camera>
13+
<a-sky color="#24CAFF"></a-sky>
1814
<a-entity
1915
id="dialog"
20-
position="0 0 -4"
16+
position="0 0 -2"
2117
dialog-popup="
2218
openIconImage: ../assets/info.jpg;
2319
closeIconImage: ../assets/close.jpg;
24-
image: ../assets/tony.jpg;
25-
title: This is an example title.
26-
body: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean dolor sem, consectetur sed nibh a, placerat semper augue. Aenean consectetur nec nunc vestibulum aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean dolor sem, consectetur sed nibh a, placerat semper augue.
27-
"/>
20+
title: Kellogg's frosted flakes;
21+
body: Frosted Flakes or Frosties is a breakfast cereal, produced by the Kellogg Company and consisting of sugar-coated corn flakes. It was introduced in the United States in 1952, as Sugar Frosted Flakes.;
22+
"></a-entity>
2823
</a-scene>
2924

3025
<!-- GitHub Corner. -->

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,6 @@ AFRAME.registerComponent('dialog-popup', {
337337
wrapper.setAttribute('id', `${this.el.getAttribute('id')}--wrapper`);
338338
wrapper.appendChild(this.generateOpenIcon());
339339
wrapper.appendChild(this.generateDialogPlane());
340-
this.el.sceneEl.appendChild(wrapper);
340+
this.el.appendChild(wrapper);
341341
}
342342
});

0 commit comments

Comments
 (0)