From e26363adf63320b635cc70e13a3f0e53b8f8a08f Mon Sep 17 00:00:00 2001 From: Cutls Date: Mon, 29 Jul 2019 01:13:53 +0900 Subject: [PATCH] Fix: when open an image modal, disabled toot selector --- app/js/common/keyshortcut.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/app/js/common/keyshortcut.js b/app/js/common/keyshortcut.js index c3dcdbce..48d9d113 100644 --- a/app/js/common/keyshortcut.js +++ b/app/js/common/keyshortcut.js @@ -137,6 +137,10 @@ $(function ($) { //矢印:選択 if (e.code == "ArrowLeft") { //left + if ($("#imagemodal").hasClass("open")) { + imgCont('next'); + return false; + } if (selectedColumn > 0) { selectedColumn-- } @@ -144,6 +148,9 @@ $(function ($) { return false; } else if (e.code == "ArrowUp") { //up + if ($("#imagemodal").hasClass("open")) { + return false; + } if (selectedToot > 0) { selectedToot-- } @@ -151,6 +158,10 @@ $(function ($) { return false; } else if (e.code == "ArrowRight") { //right + if ($("#imagemodal").hasClass("open")) { + imgCont('prev'); + return false; + } if (selectedColumn < $(".tl-box").length - 1) { selectedColumn++ } @@ -158,6 +169,9 @@ $(function ($) { return false; } else if (e.code == "ArrowDown") { //down + if ($("#imagemodal").hasClass("open")) { + return false; + } selectedToot++ tootSelector(selectedColumn, selectedToot) return false; @@ -206,19 +220,6 @@ $(function ($) { } } } - //イメージビューワー切り替え - if (e.keyCode === 37 && wv) { - if ($("#imagemodal").hasClass("open")) { - imgCont('prev'); - return false; - } - } - if (e.keyCode === 39 && wv) { - if ($("#imagemodal").hasClass("open")) { - imgCont('next'); - return false; - } - } }); //クリアボタン $("#clear").click(function () {