mirror of
https://github.com/overte-org/overte.git
synced 2025-07-22 13:33:45 +02:00
when drawing in desktop mode. Fix keyboard not showing. Fix app button not being deactivated when switching to another app.
38 lines
No EOL
1.3 KiB
HTML
38 lines
No EOL
1.3 KiB
HTML
<!--Note: change the parent postmessage second parameter due to possible security issues-->
|
|
<link rel="stylesheet" type="text/css" href="../../html/css/edit-style.css">
|
|
|
|
<style type="text/css">
|
|
#undo {
|
|
width: 438px;
|
|
height: 200px;
|
|
margin: auto;
|
|
}
|
|
</style>
|
|
<!--<button id="undoButton" onclick="undo()">Undo</button>-->
|
|
<input type="button" value="undo" disabled id="undo" onclick="undo()"></input>
|
|
|
|
|
|
<script type="text/javascript">
|
|
function undo() {
|
|
var undoEvent = {
|
|
"type" : "undo"
|
|
};
|
|
parent.postMessage(JSON.stringify(undoEvent), "*");
|
|
}
|
|
window.addEventListener("message", setUndoState, false);
|
|
function setUndoState(message) {
|
|
//document.getElementById("message").innerHTML = "message received!";
|
|
var event = JSON.parse(message.data);
|
|
if (!event.value) {
|
|
document.getElementById("undo").removeAttribute("disabled");
|
|
} else {
|
|
document.getElementById("undo").setAttribute("disabled", event.value);
|
|
}
|
|
}
|
|
|
|
restoreUndoState(JSON.parse(decodeURIComponent(window.parent.location.search).substring(1)));
|
|
function restoreUndoState(undoState) {
|
|
setUndoState({data: JSON.stringify({value: undoState.undoDisable})});
|
|
}
|
|
|
|
</script> |