From 750b92c61b545cf206fcb1ddad718dd8e50c1bc9 Mon Sep 17 00:00:00 2001 From: zombieFox Date: Sun, 1 Dec 2019 19:37:00 +0000 Subject: [PATCH] [bug] fix keyabord esc order --- src/js/keyboard.js | 15 +++------------ src/js/link.js | 26 ++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/js/keyboard.js b/src/js/keyboard.js index 30f92884..21dbf8bf 100644 --- a/src/js/keyboard.js +++ b/src/js/keyboard.js @@ -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); diff --git a/src/js/link.js b/src/js/link.js index 95c61971..7872b9be 100644 --- a/src/js/link.js +++ b/src/js/link.js @@ -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() {