mirror of
https://github.com/micku7zu/vanilla-tilt.js
synced 2024-06-08 16:52:13 +02:00
Adding more flexibility for mouse move events +fix order
This commit is contained in:
parent
b2dc09e48f
commit
b5af945019
4
dist/vanilla-tilt.babel.js
vendored
4
dist/vanilla-tilt.babel.js
vendored
|
@ -33,9 +33,9 @@ var VanillaTilt = function () {
|
|||
this.updateBind = this.update.bind(this);
|
||||
this.resetBind = this.reset.bind(this);
|
||||
|
||||
this.settings = this.extendSettings(settings);
|
||||
this.element = element;
|
||||
this.elementListener = this.getElementListener();
|
||||
this.settings = this.extendSettings(settings);
|
||||
|
||||
this.reverse = this.settings.reverse ? -1 : 1;
|
||||
|
||||
|
@ -60,7 +60,7 @@ var VanillaTilt = function () {
|
|||
|
||||
|
||||
VanillaTilt.prototype.getElementListener = function getElementListener() {
|
||||
if (!this.settings.mouseEventElement) {
|
||||
if (!this.settings || !this.settings.mouseEventElement) {
|
||||
return this.element;
|
||||
}
|
||||
|
||||
|
|
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
|
@ -24,9 +24,9 @@ class VanillaTilt {
|
|||
this.updateBind = this.update.bind(this);
|
||||
this.resetBind = this.reset.bind(this);
|
||||
|
||||
this.settings = this.extendSettings(settings);
|
||||
this.element = element;
|
||||
this.elementListener = this.getElementListener();
|
||||
this.settings = this.extendSettings(settings);
|
||||
|
||||
this.reverse = this.settings.reverse ? -1 : 1;
|
||||
|
||||
|
@ -49,7 +49,7 @@ class VanillaTilt {
|
|||
* @return {Node}
|
||||
*/
|
||||
getElementListener() {
|
||||
if (!this.settings.mouseEventElement) { return this.element; }
|
||||
if (!this.settings || !this.settings.mouseEventElement) { return this.element; }
|
||||
|
||||
if (typeof this.settings.mouseEventElement === 'string') {
|
||||
const mouseEventElement = document.querySelector(this.settings.mouseEventElement);
|
||||
|
|
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
|
@ -21,9 +21,9 @@ class VanillaTilt {
|
|||
this.updateBind = this.update.bind(this);
|
||||
this.resetBind = this.reset.bind(this);
|
||||
|
||||
this.settings = this.extendSettings(settings);
|
||||
this.element = element;
|
||||
this.elementListener = this.getElementListener();
|
||||
this.settings = this.extendSettings(settings);
|
||||
|
||||
this.reverse = this.settings.reverse ? -1 : 1;
|
||||
|
||||
|
@ -46,7 +46,7 @@ class VanillaTilt {
|
|||
* @return {Node}
|
||||
*/
|
||||
getElementListener() {
|
||||
if (!this.settings.mouseEventElement) { return this.element; }
|
||||
if (!this.settings || !this.settings.mouseEventElement) { return this.element; }
|
||||
|
||||
if (typeof this.settings.mouseEventElement === 'string') {
|
||||
const mouseEventElement = document.querySelector(this.settings.mouseEventElement);
|
||||
|
|
|
@ -32,9 +32,9 @@ var VanillaTilt = function () {
|
|||
this.updateBind = this.update.bind(this);
|
||||
this.resetBind = this.reset.bind(this);
|
||||
|
||||
this.settings = this.extendSettings(settings);
|
||||
this.element = element;
|
||||
this.elementListener = this.getElementListener();
|
||||
this.settings = this.extendSettings(settings);
|
||||
|
||||
this.reverse = this.settings.reverse ? -1 : 1;
|
||||
|
||||
|
@ -59,7 +59,7 @@ var VanillaTilt = function () {
|
|||
|
||||
|
||||
VanillaTilt.prototype.getElementListener = function getElementListener() {
|
||||
if (!this.settings.mouseEventElement) {
|
||||
if (!this.settings || !this.settings.mouseEventElement) {
|
||||
return this.element;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,9 +21,9 @@ export default class VanillaTilt {
|
|||
this.updateBind = this.update.bind(this);
|
||||
this.resetBind = this.reset.bind(this);
|
||||
|
||||
this.settings = this.extendSettings(settings);
|
||||
this.element = element;
|
||||
this.elementListener = this.getElementListener();
|
||||
this.settings = this.extendSettings(settings);
|
||||
|
||||
this.reverse = this.settings.reverse ? -1 : 1;
|
||||
|
||||
|
@ -46,7 +46,7 @@ export default class VanillaTilt {
|
|||
* @return {Node}
|
||||
*/
|
||||
getElementListener() {
|
||||
if (!this.settings.mouseEventElement) { return this.element; }
|
||||
if (!this.settings || !this.settings.mouseEventElement) { return this.element; }
|
||||
|
||||
if (typeof this.settings.mouseEventElement === 'string') {
|
||||
const mouseEventElement = document.querySelector(this.settings.mouseEventElement);
|
||||
|
|
Loading…
Reference in a new issue