modularload
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -99,8 +99,8 @@ 'use strict'; | ||
window.addEventListener('click', function (e) { | ||
return _this.checkClick(e); | ||
}, false); | ||
window.addEventListener('popstate', function (e) { | ||
return _this.checkState(e); | ||
}, false); | ||
this.html.addEventListener('click', function (e) { | ||
return _this.checkClick(e); | ||
}, false); | ||
this.loadEls(document); | ||
@@ -111,13 +111,15 @@ } | ||
value: function checkClick(e) { | ||
e.preventDefault(); | ||
var target = e.target; | ||
if (!e.ctrlKey && !e.metaKey) { | ||
e.preventDefault(); | ||
var target = e.target; | ||
while (target && target !== document) { | ||
if (target.matches('a')) { | ||
this.reset(); | ||
this.getClickOptions(target); | ||
break; | ||
while (target && target !== document) { | ||
if (target.matches('a')) { | ||
this.reset(); | ||
this.getClickOptions(target); | ||
break; | ||
} | ||
target = target.parentNode; | ||
} | ||
target = target.parentNode; | ||
} | ||
@@ -124,0 +126,0 @@ } |
@@ -97,8 +97,8 @@ function _classCallCheck(instance, Constructor) { | ||
window.addEventListener('click', function (e) { | ||
return _this.checkClick(e); | ||
}, false); | ||
window.addEventListener('popstate', function (e) { | ||
return _this.checkState(e); | ||
}, false); | ||
this.html.addEventListener('click', function (e) { | ||
return _this.checkClick(e); | ||
}, false); | ||
this.loadEls(document); | ||
@@ -109,13 +109,15 @@ } | ||
value: function checkClick(e) { | ||
e.preventDefault(); | ||
var target = e.target; | ||
if (!e.ctrlKey && !e.metaKey) { | ||
e.preventDefault(); | ||
var target = e.target; | ||
while (target && target !== document) { | ||
if (target.matches('a')) { | ||
this.reset(); | ||
this.getClickOptions(target); | ||
break; | ||
while (target && target !== document) { | ||
if (target.matches('a')) { | ||
this.reset(); | ||
this.getClickOptions(target); | ||
break; | ||
} | ||
target = target.parentNode; | ||
} | ||
target = target.parentNode; | ||
} | ||
@@ -122,0 +124,0 @@ } |
{ | ||
"name": "modularload", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Dead simple page transitions and lazy loading.", | ||
@@ -5,0 +5,0 @@ "repository": "modularorg/modularload", |
@@ -34,4 +34,4 @@ export default class { | ||
init() { | ||
window.addEventListener('click', (e) => this.checkClick(e), false); | ||
window.addEventListener('popstate', (e) => this.checkState(e), false); | ||
this.html.addEventListener('click', (e) => this.checkClick(e), false); | ||
@@ -42,15 +42,17 @@ this.loadEls(document); | ||
checkClick(e) { | ||
e.preventDefault(); | ||
if (!e.ctrlKey && !e.metaKey) { | ||
e.preventDefault(); | ||
let target = e.target; | ||
let target = e.target; | ||
while (target && target !== document) { | ||
if (target.matches('a')) { | ||
this.reset(); | ||
this.getClickOptions(target); | ||
break; | ||
} | ||
while (target && target !== document) { | ||
if (target.matches('a')) { | ||
this.reset(); | ||
this.getClickOptions(target); | ||
break; | ||
} | ||
target = target.parentNode; | ||
}; | ||
target = target.parentNode; | ||
}; | ||
} | ||
} | ||
@@ -57,0 +59,0 @@ |
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
40198
994