Skip to content

Commit 9b40122

Browse files
committed
Make info message height configurable
1 parent 6883f14 commit 9b40122

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

‎examples/js/info-message.js‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
AFRAME.registerComponent('info-message', {
33
schema: {
44
htmlSrc: {type: 'selector'},
5-
startOpened: {default: false}
5+
startOpened: {default: false},
6+
width: {default: 400},
7+
height: {default: 320}
68
},
79
init: function () {
810
var sceneEl = this.el.sceneEl;
@@ -25,6 +27,7 @@ AFRAME.registerComponent('info-message', {
2527

2628
this.messageEl.style.display = startOpened ? '' : 'none';
2729
this.infoButton.style.display = startOpened ? 'none' : '';
30+
messageEl.addEventListener('click', function (evt) { evt.stopPropagation(); });
2831
},
2932

3033
update: function () {
@@ -35,8 +38,8 @@ AFRAME.registerComponent('info-message', {
3538

3639
addStyles: function () {
3740
var css =
38-
'.a-info-message{border-radius: 10px; position: absolute; width: 400px;' +
39-
'height: 320px; background-color: white; border: 3px solid rgba(0,0,0,.75);' +
41+
'.a-info-message{border-radius: 10px; position: absolute; width: ' + this.data.width + 'px;' +
42+
'height: ' + this.data.height + 'px; background-color: white; border: 3px solid rgba(0,0,0,.75);' +
4043
'bottom: 22px; left: 22px; color: rgb(51, 51, 51); padding: 20px 15px 0 15px;' +
4144
'font-size: 11pt; line-height: 20pt;}' +
4245

0 commit comments

Comments
 (0)