From 3ee3714664deae5381f383c3305a578041ea0cb0 Mon Sep 17 00:00:00 2001 From: Edwin Wong Date: Sat, 30 Sep 2023 01:43:19 +0800 Subject: [PATCH] feat: back and save --- js/ShapeFlowEditor.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/ShapeFlowEditor.js b/js/ShapeFlowEditor.js index d8551d9..b294b72 100644 --- a/js/ShapeFlowEditor.js +++ b/js/ShapeFlowEditor.js @@ -14,6 +14,13 @@ export function ShapeFlowEditor() { (showEditor.val ? "" : "hidden"), onclick: () => { console.log("close"); + const editor = document.getElementById("avatech-editor-iframe"); + editor.contentWindow.postMessage( + { + method: "back", + }, + "*" + ); showEditor.val = false; }, }, @@ -22,7 +29,7 @@ export function ShapeFlowEditor() { "data-icon": "ic:baseline-arrow-back", "data-inline": "false", }), - div("Back") + div("Back & Save") ), iframe({ id: "avatech-editor-iframe",