[bug] fix modal not closing when opening menu by keyboard shortcut

This commit is contained in:
zombieFox 2020-01-03 12:40:20 -07:00
parent ac8b56c838
commit 0e703dfd31
5 changed files with 22 additions and 5 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "nighttab",
"version": "4.8.0",
"version": "4.8.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "nighttab",
"version": "4.8.0",
"version": "4.8.1",
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
"main": "index.js",
"scripts": {

View File

@ -101,9 +101,26 @@ var keyboard = (function() {
window.addEventListener("keydown", function(event) {
// ctrl+alt+m
if (event.ctrlKey && event.altKey && event.keyCode == 77) {
if (state.get.current().link.add) {
if (state.get.current().link.edit) {
link.edit.item.close();
modal.close();
shade.close();
data.save();
} else if (state.get.current().link.add) {
link.add.item.close();
modal.close();
shade.close();
data.save();
} else if (state.get.current().group.edit) {
link.edit.group.close();
modal.close();
shade.close();
data.save();
} else if (state.get.current().group.add) {
link.add.group.close();
modal.close();
shade.close();
data.save();
} else if (state.get.current().modal) {
modal.close();
shade.close();

View File

@ -1,6 +1,6 @@
var version = (function() {
var current = "4.8.0";
var current = "4.8.1";
var name = "Naughty Goose";

View File

@ -2,7 +2,7 @@
"name": "nightTab",
"short_name": "nightTab",
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
"version": "4.8.0",
"version": "4.8.1",
"manifest_version": 2,
"chrome_url_overrides": {
"newtab": "index.html"