1
0
mirror of https://github.com/MatMoul/quickdial-webext.git synced 2024-12-23 15:36:12 +00:00

Improvement: Add escape support on popup

This commit is contained in:
MatMoul 2017-10-21 17:10:51 +02:00
parent 5a2c30e00f
commit 1e5e450565
3 changed files with 16 additions and 0 deletions

View File

@ -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();
}

View File

@ -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){

View File

@ -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;