mirror of
https://github.com/micku7zu/vanilla-tilt.js
synced 2024-06-10 09:42:11 +02:00
Fix first onDeviceOrientation call from desktop
This commit is contained in:
parent
a4fb9a99cc
commit
3cf9615b1c
4
dist/vanilla-tilt.babel.js
vendored
4
dist/vanilla-tilt.babel.js
vendored
|
@ -132,6 +132,10 @@ var VanillaTilt = function () {
|
|||
};
|
||||
|
||||
VanillaTilt.prototype.onDeviceOrientation = function onDeviceOrientation(event) {
|
||||
if (event.gamma === null || event.beta === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.updateElementPosition();
|
||||
|
||||
var totalAngleX = this.settings.gyroscopeMaxAngleX - this.settings.gyroscopeMinAngleX;
|
||||
|
|
2
dist/vanilla-tilt.babel.min.js
vendored
2
dist/vanilla-tilt.babel.min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/vanilla-tilt.js
vendored
4
dist/vanilla-tilt.js
vendored
|
@ -117,6 +117,10 @@ class VanillaTilt {
|
|||
}
|
||||
|
||||
onDeviceOrientation(event) {
|
||||
if (event.gamma === null || event.beta === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.updateElementPosition();
|
||||
|
||||
const totalAngleX = this.settings.gyroscopeMaxAngleX - this.settings.gyroscopeMinAngleX;
|
||||
|
|
2
dist/vanilla-tilt.min.js
vendored
2
dist/vanilla-tilt.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -114,6 +114,10 @@ class VanillaTilt {
|
|||
}
|
||||
|
||||
onDeviceOrientation(event) {
|
||||
if (event.gamma === null || event.beta === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.updateElementPosition();
|
||||
|
||||
const totalAngleX = this.settings.gyroscopeMaxAngleX - this.settings.gyroscopeMinAngleX;
|
||||
|
|
|
@ -131,6 +131,10 @@ var VanillaTilt = function () {
|
|||
};
|
||||
|
||||
VanillaTilt.prototype.onDeviceOrientation = function onDeviceOrientation(event) {
|
||||
if (event.gamma === null || event.beta === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.updateElementPosition();
|
||||
|
||||
var totalAngleX = this.settings.gyroscopeMaxAngleX - this.settings.gyroscopeMinAngleX;
|
||||
|
|
|
@ -114,6 +114,10 @@ export default class VanillaTilt {
|
|||
}
|
||||
|
||||
onDeviceOrientation(event) {
|
||||
if (event.gamma === null || event.beta === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.updateElementPosition();
|
||||
|
||||
const totalAngleX = this.settings.gyroscopeMaxAngleX - this.settings.gyroscopeMinAngleX;
|
||||
|
|
Loading…
Reference in a new issue