[bug] fix add and edit modals not closing when using keyboard shortcuts
This commit is contained in:
parent
95da1a80f7
commit
25fb5b1f78
|
@ -50,16 +50,31 @@ var keyboard = (function() {
|
||||||
window.addEventListener("keydown", function(event) {
|
window.addEventListener("keydown", function(event) {
|
||||||
// ctrl+alt+a
|
// ctrl+alt+a
|
||||||
if (event.ctrlKey && event.altKey && event.keyCode == 65) {
|
if (event.ctrlKey && event.altKey && event.keyCode == 65) {
|
||||||
if (state.get.current().group.add) {
|
|
||||||
link.add.group.close();
|
|
||||||
};
|
|
||||||
if (!state.get.current().link.add) {
|
|
||||||
if (state.get.current().menu) {
|
if (state.get.current().menu) {
|
||||||
menu.close();
|
menu.close();
|
||||||
};
|
};
|
||||||
if (state.get.current().modal) {
|
if (state.get.current().modal && !state.get.current().link.add) {
|
||||||
modal.close();
|
modal.close();
|
||||||
};
|
};
|
||||||
|
if (state.get.current().link.edit) {
|
||||||
|
link.edit.item.close();
|
||||||
|
modal.close();
|
||||||
|
shade.close();
|
||||||
|
data.save();
|
||||||
|
};
|
||||||
|
if (state.get.current().group.edit) {
|
||||||
|
link.edit.group.close();
|
||||||
|
modal.close();
|
||||||
|
shade.close();
|
||||||
|
data.save();
|
||||||
|
};
|
||||||
|
if (state.get.current().group.add) {
|
||||||
|
link.add.group.close();
|
||||||
|
modal.close();
|
||||||
|
shade.close();
|
||||||
|
data.save();
|
||||||
|
};
|
||||||
|
if (!state.get.current().link.add) {
|
||||||
link.add.item.open();
|
link.add.item.open();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -70,16 +85,31 @@ var keyboard = (function() {
|
||||||
window.addEventListener("keydown", function(event) {
|
window.addEventListener("keydown", function(event) {
|
||||||
// ctrl+alt+g
|
// ctrl+alt+g
|
||||||
if (event.ctrlKey && event.altKey && event.keyCode == 71) {
|
if (event.ctrlKey && event.altKey && event.keyCode == 71) {
|
||||||
if (state.get.current().link.add) {
|
|
||||||
link.add.item.close();
|
|
||||||
};
|
|
||||||
if (!state.get.current().group.add) {
|
|
||||||
if (state.get.current().menu) {
|
if (state.get.current().menu) {
|
||||||
menu.close();
|
menu.close();
|
||||||
};
|
};
|
||||||
if (state.get.current().modal) {
|
if (state.get.current().modal && !state.get.current().group.add) {
|
||||||
modal.close();
|
modal.close();
|
||||||
};
|
};
|
||||||
|
if (state.get.current().link.edit) {
|
||||||
|
link.edit.item.close();
|
||||||
|
modal.close();
|
||||||
|
shade.close();
|
||||||
|
data.save();
|
||||||
|
};
|
||||||
|
if (state.get.current().link.add) {
|
||||||
|
link.add.item.close();
|
||||||
|
modal.close();
|
||||||
|
shade.close();
|
||||||
|
data.save();
|
||||||
|
};
|
||||||
|
if (state.get.current().group.edit) {
|
||||||
|
link.edit.group.close();
|
||||||
|
modal.close();
|
||||||
|
shade.close();
|
||||||
|
data.save();
|
||||||
|
};
|
||||||
|
if (!state.get.current().group.add) {
|
||||||
link.add.group.open();
|
link.add.group.open();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -106,22 +136,26 @@ var keyboard = (function() {
|
||||||
modal.close();
|
modal.close();
|
||||||
shade.close();
|
shade.close();
|
||||||
data.save();
|
data.save();
|
||||||
} else if (state.get.current().link.add) {
|
};
|
||||||
|
if (state.get.current().link.add) {
|
||||||
link.add.item.close();
|
link.add.item.close();
|
||||||
modal.close();
|
modal.close();
|
||||||
shade.close();
|
shade.close();
|
||||||
data.save();
|
data.save();
|
||||||
} else if (state.get.current().group.edit) {
|
};
|
||||||
|
if (state.get.current().group.edit) {
|
||||||
link.edit.group.close();
|
link.edit.group.close();
|
||||||
modal.close();
|
modal.close();
|
||||||
shade.close();
|
shade.close();
|
||||||
data.save();
|
data.save();
|
||||||
} else if (state.get.current().group.add) {
|
};
|
||||||
|
if (state.get.current().group.add) {
|
||||||
link.add.group.close();
|
link.add.group.close();
|
||||||
modal.close();
|
modal.close();
|
||||||
shade.close();
|
shade.close();
|
||||||
data.save();
|
data.save();
|
||||||
} else if (state.get.current().modal) {
|
};
|
||||||
|
if (state.get.current().modal) {
|
||||||
modal.close();
|
modal.close();
|
||||||
shade.close();
|
shade.close();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue