a-frame-components
Advanced tools
Comparing version 1.0.24 to 1.0.25
@@ -74,4 +74,7 @@ import { AFRAME } from "../../painter/root"; | ||
el.emit('clicked', { | ||
data: data | ||
data: me.data | ||
}); | ||
el.emit('item-clicked', { | ||
data: me.data | ||
}); | ||
if (me.data.enabled) { | ||
@@ -82,14 +85,4 @@ // console.log('I was clicked at: ', evt.detail.intersection.point); // Commented out to use own made click event without defining detail | ||
el.emit('changed', { | ||
data: data | ||
data: me.data | ||
}); | ||
var guiInteractable = el.getAttribute("gui-interactable"); | ||
//console.log("guiInteractable: "+guiInteractable); | ||
var clickActionFunctionName = guiInteractable.clickAction; | ||
//console.log("clickActionFunctionName: "+clickActionFunctionName); | ||
// find object | ||
var clickActionFunction = window[clickActionFunctionName]; | ||
//console.log("clickActionFunction: "+clickActionFunction); | ||
// is object a function? | ||
if (typeof clickActionFunction === "function") | ||
clickActionFunction(evt); | ||
evt.preventDefault(); | ||
@@ -96,0 +89,0 @@ } |
@@ -20,2 +20,3 @@ import { AFRAME } from "../../painter/root"; | ||
flexDirection: { type: 'string', default: 'row' }, | ||
value: { type: 'string', default: '' }, | ||
selected: { type: 'number', default: 0 }, | ||
@@ -58,2 +59,9 @@ open: { type: 'boolean', default: false }, | ||
this.children = this.el.getChildEntities(); | ||
this.el.addEventListener('item-clicked', function (evt) { | ||
var _a, _b; | ||
var detail = evt.detail; | ||
if (((_a = detail === null || detail === void 0 ? void 0 : detail.data) === null || _a === void 0 ? void 0 : _a.value) !== me.data.value) { | ||
me.el.emit('change', { value: (_b = detail === null || detail === void 0 ? void 0 : detail.data) === null || _b === void 0 ? void 0 : _b.value }); | ||
} | ||
}); | ||
this.positionChildren(containerGuiItem); | ||
@@ -98,3 +106,2 @@ var _a = this.createEntryPanel(), entity = _a.entity, bucket = _a.bucket, entryPanel = _a.entryPanel; | ||
entryPanel.setAttribute('font-size', ".07"); | ||
entryPanel.addEventListener('clicked', function () { }); | ||
var entity = document.createElement('a-entity'); | ||
@@ -356,2 +363,3 @@ var entity2 = document.createElement('a-entity'); | ||
'margin': 'gui-item.margin', | ||
'value': 'gui-menu-container.value', | ||
'text-value': 'gui-menu-container.text', | ||
@@ -358,0 +366,0 @@ 'selected': 'gui-menu-container.selected', |
{ | ||
"name": "a-frame-components", | ||
"version": "1.0.24", | ||
"version": "1.0.25", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -75,5 +75,8 @@ import { AFRAME } from "../../painter/root"; | ||
el.addEventListener(data.on, function (evt) { | ||
el.addEventListener(data.on, function (evt: any) { | ||
el.emit('clicked', { | ||
data | ||
data: me.data | ||
}); | ||
el.emit('item-clicked', { | ||
data: me.data | ||
}) | ||
@@ -85,14 +88,4 @@ if (me.data.enabled) { | ||
el.emit('changed', { | ||
data | ||
data: me.data | ||
}) | ||
var guiInteractable = el.getAttribute("gui-interactable"); | ||
//console.log("guiInteractable: "+guiInteractable); | ||
var clickActionFunctionName = guiInteractable.clickAction; | ||
//console.log("clickActionFunctionName: "+clickActionFunctionName); | ||
// find object | ||
var clickActionFunction: any = window[clickActionFunctionName]; | ||
//console.log("clickActionFunction: "+clickActionFunction); | ||
// is object a function? | ||
if (typeof clickActionFunction === "function") clickActionFunction(evt); | ||
evt.preventDefault(); | ||
@@ -99,0 +92,0 @@ } |
@@ -22,2 +22,3 @@ import { AFRAME } from "../../painter/root"; | ||
flexDirection: { type: 'string', default: 'row' }, | ||
value: { type: 'string', default: '' }, | ||
selected: { type: 'number', default: 0 }, | ||
@@ -63,2 +64,9 @@ open: { type: 'boolean', default: false }, | ||
this.children = this.el.getChildEntities(); | ||
this.el.addEventListener('item-clicked', (evt) => { | ||
const { detail } = evt; | ||
if (detail?.data?.value !== me.data.value) { | ||
me.el.emit('change', { value: detail?.data?.value }) | ||
} | ||
}); | ||
this.positionChildren(containerGuiItem); | ||
@@ -105,3 +113,2 @@ let { entity, bucket, entryPanel } = this.createEntryPanel(); | ||
entryPanel.setAttribute('font-size', ".07") | ||
entryPanel.addEventListener('clicked', () => { }) | ||
let entity = document.createElement('a-entity'); | ||
@@ -356,2 +363,3 @@ let entity2 = document.createElement('a-entity'); | ||
'margin': 'gui-item.margin', | ||
'value': 'gui-menu-container.value', | ||
'text-value': 'gui-menu-container.text', | ||
@@ -358,0 +366,0 @@ 'selected': 'gui-menu-container.selected', |
@@ -451,2 +451,3 @@ // aframe.d.ts | ||
width?: string; | ||
value?: string; | ||
height?: string; | ||
@@ -453,0 +454,0 @@ margin?: string; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28385
1672112