(function(F){ "use strict"; const D = F.dom, P = F.pikchr = {}; P.addSrcView = function f(svg){ if(!f.hasOwnProperty('parentClick')){ f.parentClick = function(ev){ if(ev.altKey || ev.metaKey || ev.ctrlKey || this.classList.contains('toggle')){ this.classList.toggle('source'); ev.stopPropagation(); ev.preventDefault(); } }; }; if(!svg) svg = 'svg.pikchr'; if('string' === typeof svg){ document.querySelectorAll(svg).forEach((e)=>f.call(this, e)); return this; }else if(svg.forEach){ svg.forEach((e)=>f.call(this, e)); return this; } if(svg.dataset.pikchrProcessed){ return this; } svg.dataset.pikchrProcessed = 1; const parent = svg.parentNode.parentNode; const srcView = parent ? svg.parentNode.nextElementSibling : undefined; if(!srcView || !srcView.classList.contains('pikchr-src')){ return this; } parent.addEventListener('click', f.parentClick, false); return this; }; })(window.fossil);