From 58bb89c87c06e2d85edff3a9dd5bda2d179320aa Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Wed, 10 Jun 2020 22:14:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E6=9C=AA=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E5=88=B7=E6=96=B0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _server/editor_listen.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/_server/editor_listen.js b/_server/editor_listen.js index 3eb74545..12bba2a9 100644 --- a/_server/editor_listen.js +++ b/_server/editor_listen.js @@ -51,6 +51,14 @@ editor_listen_wrapper = function (editor) { if (editor.dom.layerMod3) editor.dom.layerMod3.onchange = editor.uifunctions.layerMod3_onchange; editor.uifunctions.viewportButtons_func() + + window.onbeforeunload = function () { + var saveFloor = document.getElementById('saveFloor'); + if (saveFloor && saveFloor.classList.contains('highlight')) { + return '你尚未保存地图,确定退出么?'; + } + return null; + } } editor.constructor.prototype.mobile_listen = function () {