-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use component event handlers insted of bound a-scene methods #3213
Conversation
src/components/scene/vr-mode-ui.js
Outdated
@@ -55,10 +61,10 @@ module.exports.Component = registerComponent('vr-mode-ui', { | |||
if (this.enterVREl || this.orientationModalEl) { return; } | |||
|
|||
// Add UI if enabled and not already present. | |||
this.enterVREl = createEnterVRButton(this.enterVR); | |||
this.enterVREl = createEnterVRButton(this.onEnterVRButtonClick.bind(this)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd bind in init
src/components/scene/vr-mode-ui.js
Outdated
* Create a modal that tells mobile users to orient the phone to landscape. | ||
* Add a close button that if clicked, exits VR and closes the modal. | ||
* Creates a modal dialog to request the user to switch to landscape orientation. | ||
* * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double star
src/components/scene/vr-mode-ui.js
Outdated
@@ -46,6 +44,14 @@ module.exports.Component = registerComponent('vr-mode-ui', { | |||
bind(this.toggleOrientationModalIfNeeded, this)); | |||
}, | |||
|
|||
onModalClick: function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docstrings (Exit VR when modal clicked.
- Enter VR when VR button clicked.
)
df216d6
to
717f1f3
Compare
717f1f3
to
3317348
Compare
It is more hygienic to use dedicated event handlers than directly wrapped methods of
a-scene
. This became a problem with some experiments that were attempting at wrappinga-scene
methods.