diff --git a/src/js/dial.js b/src/js/dial.js index 3530758..cfd241d 100644 --- a/src/js/dial.js +++ b/src/js/dial.js @@ -495,6 +495,7 @@ dial.editSettings = function(){ iframe.src = '/html/settings.html'; iframe.popup = popup; popup.popup(); + iframe.focus(); } dial.editProperties = function(selectedItem){ @@ -510,4 +511,5 @@ dial.editProperties = function(selectedItem){ iframe.src = '/html/properties.html?id=' + selectedItem.Node.id; iframe.popup = popup; popup.popup(); + iframe.focus(); } diff --git a/src/js/properties.js b/src/js/properties.js index c17d946..b37e711 100644 --- a/src/js/properties.js +++ b/src/js/properties.js @@ -7,6 +7,13 @@ document.addEventListener("DOMContentLoaded", function(event) { }); app.init = function(){ + document.addEventListener('keyup', function(e){ + switch(e.key){ + case 'Escape': + window.frameElement.popup.close(); + break; + } + }); app.Messages.getSettings(function(settings){ app.settings = settings; app.Messages.getNodeByID(new URL(window.location).searchParams.get('id'), function(node){ diff --git a/src/js/settings.js b/src/js/settings.js index c921771..6d46cb0 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -10,6 +10,13 @@ document.addEventListener("DOMContentLoaded", function(event) { app.init = function(){ + document.addEventListener('keyup', function(e){ + switch(e.key){ + case 'Escape': + window.frameElement.popup.close(); + break; + } + }); app.Messages.getSettings(function(settings){ app.settings = settings; BackgroundColor.value = app.settings.backgroundColor;