Publii: update content
This commit is contained in:
parent
d8a928e39b
commit
93675169d5
124 changed files with 3107 additions and 173 deletions
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);
|
||||
}
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue