[bug] fix keyabord esc order

This commit is contained in:
zombieFox 2019-12-01 19:37:00 +00:00
parent b38bf8f199
commit 750b92c61b
2 changed files with 27 additions and 14 deletions

View File

@ -10,22 +10,17 @@ var keyboard = (function() {
edge.box.close();
} else if (state.get().menu) {
menu.close();
shade.close();
} else if (state.get().dropdown) {
dropdown.close();
} else if (state.get().autoSuggest) {
autoSuggest.close();
} else if (state.get().link.add) {
link.add.item.close();
shade.close();
} else if (state.get().group.add) {
link.add.group.close();
shade.close();
} else if (state.get().link.edit) {
link.add.item.close();
shade.close();
control.render.update();
control.render.class();
link.edit.close();
data.save();
} else if (state.get().modal) {
modal.close();
shade.close();
@ -93,7 +88,6 @@ var keyboard = (function() {
if (state.get().link.add) {
link.add.item.close();
link.add.group.close();
shade.close();
} else if (state.get().modal) {
modal.close();
shade.close();
@ -107,10 +101,7 @@ var keyboard = (function() {
window.addEventListener("keydown", function(event) {
// ctrl+alt+e
if (event.ctrlKey && event.altKey && event.keyCode == 69) {
link.edit();
link.tabindex();
control.render.update();
control.render.class();
link.edit.toggle();
data.save();
};
}, false);

View File

@ -1386,6 +1386,7 @@ var link = (function() {
mod.add.item.close();
stagedLink.reset();
modal.close();
shade.close();
pagelock.unlock();
},
selectGroup: function(groupIndex) {
@ -1444,6 +1445,7 @@ var link = (function() {
mod.add.group.close();
stagedGroup.reset();
modal.close();
shade.close();
pagelock.unlock();
}
}
@ -1654,8 +1656,28 @@ var link = (function() {
}
};
var edit = function() {
mod.edit.toggle();
var edit = {
toggle: function() {
mod.edit.toggle();
render.group.tabindex();
render.item.tabindex();
control.render.update();
control.render.class();
},
open: function() {
mod.edit.open();
render.group.tabindex();
render.item.tabindex();
control.render.update();
control.render.class();
},
close: function() {
mod.edit.close();
render.group.tabindex();
render.item.tabindex();
control.render.update();
control.render.class();
}
};
var tabindex = function() {