import { stageManager } from "./stage-manager"; class HeaderMenu { constructor() { $("body").on("click", "#save", this.save.bind(this)); } bootstrap() {} save() { const layer = stageManager.getCurrentLayer(); const file = layer.actionManager.save(); var a = document.createElement("a"), url = URL.createObjectURL(file); a.href = url; a.download = `${layer.name}.geo`; document.body.appendChild(a); a.click(); setTimeout(function() { document.body.removeChild(a); window.URL.revokeObjectURL(url); }, 0); } } export const headerMenu = new HeaderMenu();