modularload
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -84,3 +84,6 @@ 'use strict'; | ||
this.html = document.documentElement; | ||
this.href = window.location.href; | ||
this.container = 'data-' + this.name + '-container'; | ||
this.subContainer = false; | ||
this.prevTransition = null; | ||
this.loadAttributes = ['src', 'srcset', 'style', 'href']; | ||
@@ -187,6 +190,20 @@ this.classContainer = this.html; | ||
this.classContainer = this.oldContainer.parentNode; | ||
if (!this.subContainer) { | ||
history.replaceState(this.transition, null, this.href); | ||
} | ||
this.subContainer = true; | ||
} else { | ||
this.prevTransition = this.transition; | ||
this.oldContainer = document.querySelector(container); | ||
if (this.subContainer) { | ||
history.replaceState(this.prevTransition, null, this.href); | ||
} | ||
this.subContainer = false; | ||
} | ||
this.href = href; | ||
this.oldContainer.classList.add('is-old'); | ||
@@ -193,0 +210,0 @@ this.setLoading(); |
@@ -82,3 +82,6 @@ function _classCallCheck(instance, Constructor) { | ||
this.html = document.documentElement; | ||
this.href = window.location.href; | ||
this.container = 'data-' + this.name + '-container'; | ||
this.subContainer = false; | ||
this.prevTransition = null; | ||
this.loadAttributes = ['src', 'srcset', 'style', 'href']; | ||
@@ -185,6 +188,20 @@ this.classContainer = this.html; | ||
this.classContainer = this.oldContainer.parentNode; | ||
if (!this.subContainer) { | ||
history.replaceState(this.transition, null, this.href); | ||
} | ||
this.subContainer = true; | ||
} else { | ||
this.prevTransition = this.transition; | ||
this.oldContainer = document.querySelector(container); | ||
if (this.subContainer) { | ||
history.replaceState(this.prevTransition, null, this.href); | ||
} | ||
this.subContainer = false; | ||
} | ||
this.href = href; | ||
this.oldContainer.classList.add('is-old'); | ||
@@ -191,0 +208,0 @@ this.setLoading(); |
{ | ||
"name": "modularload", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Dead simple page transitions and lazy loading.", | ||
@@ -5,0 +5,0 @@ "repository": "modularorg/modularload", |
@@ -20,3 +20,6 @@ export default class { | ||
this.html = document.documentElement; | ||
this.href = window.location.href; | ||
this.container = 'data-' + this.name + '-container'; | ||
this.subContainer = false; | ||
this.prevTransition = null; | ||
this.loadAttributes = ['src', 'srcset', 'style', 'href']; | ||
@@ -90,4 +93,4 @@ | ||
this.transition = history.state; | ||
const href = window.location.href; | ||
this.setOptions(href); | ||
@@ -117,6 +120,21 @@ } | ||
this.classContainer = this.oldContainer.parentNode; | ||
if (!this.subContainer) { | ||
history.replaceState(this.transition, null, this.href); | ||
} | ||
this.subContainer = true; | ||
} else { | ||
this.prevTransition = this.transition; | ||
this.oldContainer = document.querySelector(container); | ||
if (this.subContainer) { | ||
history.replaceState(this.prevTransition, null, this.href); | ||
} | ||
this.subContainer = false; | ||
} | ||
this.href = href; | ||
this.oldContainer.classList.add('is-old'); | ||
@@ -123,0 +141,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
39240
988