modularload
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -85,2 +85,3 @@ 'use strict'; | ||
this.isEntered = false; | ||
this.isChrome = navigator.userAgent.indexOf("Chrome") != -1 ? true : false; | ||
this.init(); | ||
@@ -223,2 +224,4 @@ } | ||
_this3.setSvgs(); | ||
_this3.setAttributes(data); | ||
@@ -251,2 +254,22 @@ | ||
}, { | ||
key: "setSvgs", | ||
value: function setSvgs() { | ||
if (this.isChrome) { | ||
var svgs = this.newContainer.querySelectorAll('use'); | ||
if (svgs.length) { | ||
svgs.forEach(function (svg) { | ||
var xhref = svg.getAttribute('xlink:href'); | ||
if (xhref) { | ||
svg.setAttribute('xlink:href', xhref); | ||
} else { | ||
var href = svg.getAttribute('href'); | ||
if (href) svg.setAttribute('href', href); | ||
} | ||
}); | ||
} | ||
} | ||
} | ||
}, { | ||
key: "setAttributes", | ||
@@ -253,0 +276,0 @@ value: function setAttributes(data) { |
@@ -83,2 +83,3 @@ function _classCallCheck(instance, Constructor) { | ||
this.isEntered = false; | ||
this.isChrome = navigator.userAgent.indexOf("Chrome") != -1 ? true : false; | ||
this.init(); | ||
@@ -221,2 +222,4 @@ } | ||
_this3.setSvgs(); | ||
_this3.setAttributes(data); | ||
@@ -249,2 +252,22 @@ | ||
}, { | ||
key: "setSvgs", | ||
value: function setSvgs() { | ||
if (this.isChrome) { | ||
var svgs = this.newContainer.querySelectorAll('use'); | ||
if (svgs.length) { | ||
svgs.forEach(function (svg) { | ||
var xhref = svg.getAttribute('xlink:href'); | ||
if (xhref) { | ||
svg.setAttribute('xlink:href', xhref); | ||
} else { | ||
var href = svg.getAttribute('href'); | ||
if (href) svg.setAttribute('href', href); | ||
} | ||
}); | ||
} | ||
} | ||
} | ||
}, { | ||
key: "setAttributes", | ||
@@ -251,0 +274,0 @@ value: function setAttributes(data) { |
{ | ||
"name": "modularload", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Dead simple page transitions and lazy loading.", | ||
@@ -5,0 +5,0 @@ "repository": "modularorg/modularload", |
@@ -23,2 +23,4 @@ export default class { | ||
this.isChrome = (navigator.userAgent.indexOf("Chrome") != -1) ? true : false; | ||
this.init(); | ||
@@ -145,2 +147,3 @@ } | ||
this.setSvgs(); | ||
this.setAttributes(data); | ||
@@ -170,2 +173,20 @@ | ||
setSvgs() { | ||
if (this.isChrome) { | ||
const svgs = this.newContainer.querySelectorAll('use'); | ||
if (svgs.length) { | ||
svgs.forEach((svg) => { | ||
const xhref = svg.getAttribute('xlink:href'); | ||
if (xhref) { | ||
svg.setAttribute('xlink:href', xhref); | ||
} else { | ||
const href = svg.getAttribute('href'); | ||
if (href) svg.setAttribute('href', href); | ||
} | ||
}); | ||
} | ||
} | ||
} | ||
setAttributes(data) { | ||
@@ -172,0 +193,0 @@ const title = data.getElementsByTagName('title')[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
34988
904