MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 2:
 
function runUntilSuccess(f) {
console.log("Running function");
(function run() {
if (!f()) {
console.log("Rerunning function");
setTimeout(run, 10);
}
Line 60 ⟶ 62:
console.log("SVG found");
var clone = svgs[0].cloneNode(true);
canvas.remove();
parent.appendChild(clone);
var bbox = clone.getBBox();
clone.setAttribute("width", `${bbox.width}px`);
clone.setAttribute("height", `${bbox.height}px`);