modularload
Advanced tools
Comparing version 1.0.9 to 1.1.0
@@ -247,4 +247,4 @@ 'use strict'; | ||
var parser = new DOMParser(); | ||
data = parser.parseFromString(data, 'text/html'); | ||
_this3.newContainer = data.querySelector(container); | ||
_this3.data = parser.parseFromString(data, 'text/html'); | ||
_this3.newContainer = _this3.data.querySelector(container); | ||
@@ -259,4 +259,2 @@ _this3.newContainer.classList.add('is-new'); | ||
_this3.setAttributes(data); | ||
if (_this3.isEntered) { | ||
@@ -278,2 +276,3 @@ _this3.transitionContainers(); | ||
this.setAttributes(); | ||
this.showContainer(); | ||
@@ -309,6 +308,6 @@ this.setLoaded(); | ||
key: "setAttributes", | ||
value: function setAttributes(data) { | ||
var title = data.getElementsByTagName('title')[0]; | ||
var description = data.head.querySelector('meta[name="description"]'); | ||
var datas = Object.assign({}, data.querySelector('html').dataset); | ||
value: function setAttributes() { | ||
var title = this.data.getElementsByTagName('title')[0]; | ||
var description = this.data.head.querySelector('meta[name="description"]'); | ||
var datas = Object.assign({}, this.data.querySelector('html').dataset); | ||
if (title) document.title = title.innerHTML; | ||
@@ -337,5 +336,5 @@ if (description) document.head.querySelector('meta[name="description"]').setAttribute('content', description.getAttribute('content')); | ||
value: function showContainer() { | ||
this.newContainer.style.visibility = 'visible'; | ||
this.newContainer.style.height = 'auto'; | ||
this.newContainer.style.overflow = 'auto'; | ||
this.newContainer.style.visibility = ''; | ||
this.newContainer.style.height = ''; | ||
this.newContainer.style.overflow = ''; | ||
} | ||
@@ -376,4 +375,4 @@ }, { | ||
value: function setLoaded() { | ||
this.classContainer.classList.remove(this.loadingClass); | ||
this.classContainer.classList.add(this.loadedClass); | ||
this.classContainer.classList.remove(this.loadingClass); | ||
var loadedEvent = new Event(this.namespace + 'loaded'); | ||
@@ -380,0 +379,0 @@ window.dispatchEvent(loadedEvent); |
@@ -245,4 +245,4 @@ function _classCallCheck(instance, Constructor) { | ||
var parser = new DOMParser(); | ||
data = parser.parseFromString(data, 'text/html'); | ||
_this3.newContainer = data.querySelector(container); | ||
_this3.data = parser.parseFromString(data, 'text/html'); | ||
_this3.newContainer = _this3.data.querySelector(container); | ||
@@ -257,4 +257,2 @@ _this3.newContainer.classList.add('is-new'); | ||
_this3.setAttributes(data); | ||
if (_this3.isEntered) { | ||
@@ -276,2 +274,3 @@ _this3.transitionContainers(); | ||
this.setAttributes(); | ||
this.showContainer(); | ||
@@ -307,6 +306,6 @@ this.setLoaded(); | ||
key: "setAttributes", | ||
value: function setAttributes(data) { | ||
var title = data.getElementsByTagName('title')[0]; | ||
var description = data.head.querySelector('meta[name="description"]'); | ||
var datas = Object.assign({}, data.querySelector('html').dataset); | ||
value: function setAttributes() { | ||
var title = this.data.getElementsByTagName('title')[0]; | ||
var description = this.data.head.querySelector('meta[name="description"]'); | ||
var datas = Object.assign({}, this.data.querySelector('html').dataset); | ||
if (title) document.title = title.innerHTML; | ||
@@ -335,5 +334,5 @@ if (description) document.head.querySelector('meta[name="description"]').setAttribute('content', description.getAttribute('content')); | ||
value: function showContainer() { | ||
this.newContainer.style.visibility = 'visible'; | ||
this.newContainer.style.height = 'auto'; | ||
this.newContainer.style.overflow = 'auto'; | ||
this.newContainer.style.visibility = ''; | ||
this.newContainer.style.height = ''; | ||
this.newContainer.style.overflow = ''; | ||
} | ||
@@ -374,4 +373,4 @@ }, { | ||
value: function setLoaded() { | ||
this.classContainer.classList.remove(this.loadingClass); | ||
this.classContainer.classList.add(this.loadedClass); | ||
this.classContainer.classList.remove(this.loadingClass); | ||
var loadedEvent = new Event(this.namespace + 'loaded'); | ||
@@ -378,0 +377,0 @@ window.dispatchEvent(loadedEvent); |
{ | ||
"name": "modularload", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"description": "Dead simple page transitions and lazy loading.", | ||
@@ -5,0 +5,0 @@ "repository": "modularorg/modularload", |
@@ -172,5 +172,5 @@ export default class { | ||
const parser = new DOMParser(); | ||
data = parser.parseFromString(data, 'text/html'); | ||
this.data = parser.parseFromString(data, 'text/html'); | ||
this.newContainer = data.querySelector(container); | ||
this.newContainer = this.data.querySelector(container); | ||
this.newContainer.classList.add('is-new'); | ||
@@ -183,3 +183,2 @@ | ||
this.setSvgs(); | ||
this.setAttributes(data); | ||
@@ -199,2 +198,3 @@ if (this.isEntered) { | ||
transitionContainers() { | ||
this.setAttributes(); | ||
this.showContainer(); | ||
@@ -227,6 +227,6 @@ this.setLoaded(); | ||
setAttributes(data) { | ||
const title = data.getElementsByTagName('title')[0]; | ||
const description = data.head.querySelector('meta[name="description"]'); | ||
const datas = Object.assign({}, data.querySelector('html').dataset); | ||
setAttributes() { | ||
const title = this.data.getElementsByTagName('title')[0]; | ||
const description = this.data.head.querySelector('meta[name="description"]'); | ||
const datas = Object.assign({}, this.data.querySelector('html').dataset); | ||
@@ -249,5 +249,5 @@ if (title) document.title = title.innerHTML; | ||
showContainer() { | ||
this.newContainer.style.visibility = 'visible'; | ||
this.newContainer.style.height = 'auto'; | ||
this.newContainer.style.overflow = 'auto'; | ||
this.newContainer.style.visibility = ''; | ||
this.newContainer.style.height = ''; | ||
this.newContainer.style.overflow = ''; | ||
} | ||
@@ -284,4 +284,4 @@ | ||
setLoaded() { | ||
this.classContainer.classList.remove(this.loadingClass); | ||
this.classContainer.classList.add(this.loadedClass); | ||
this.classContainer.classList.remove(this.loadingClass); | ||
@@ -288,0 +288,0 @@ const loadedEvent = new Event(this.namespace + 'loaded'); |
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
39967