mirror of
https://github.com/thewesker/pacnpal_com.git
synced 2025-12-22 13:11:08 -05:00
Updated from Publii
This commit is contained in:
19
assets/js/svg-fix.js
Executable file
19
assets/js/svg-fix.js
Executable file
@@ -0,0 +1,19 @@
|
||||
// SVG map fix
|
||||
(function() {
|
||||
var allItems = document.querySelectorAll('use');
|
||||
|
||||
for (var i = 0; i < allItems.length; i++) {
|
||||
var item = allItems[i];
|
||||
var anchor = '#' + item.getAttribute('xlink:href').split('#')[1];
|
||||
var itemData = window.publiiSvgFix[anchor];
|
||||
|
||||
if(!itemData) {
|
||||
console.log('ANCHOR', anchor, i);
|
||||
continue;
|
||||
}
|
||||
|
||||
var svgItem = item.parentNode;
|
||||
svgItem.innerHTML = itemData.content;
|
||||
svgItem.setAttribute('viewBox', itemData.viewbox);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user