Fix: when open an image modal, disabled toot selector

This commit is contained in:
Cutls 2019-07-29 01:13:53 +09:00
parent 35d97d42c5
commit e26363adf6

View File

@ -137,6 +137,10 @@ $(function ($) {
//矢印:選択 //矢印:選択
if (e.code == "ArrowLeft") { if (e.code == "ArrowLeft") {
//left //left
if ($("#imagemodal").hasClass("open")) {
imgCont('next');
return false;
}
if (selectedColumn > 0) { if (selectedColumn > 0) {
selectedColumn-- selectedColumn--
} }
@ -144,6 +148,9 @@ $(function ($) {
return false; return false;
} else if (e.code == "ArrowUp") { } else if (e.code == "ArrowUp") {
//up //up
if ($("#imagemodal").hasClass("open")) {
return false;
}
if (selectedToot > 0) { if (selectedToot > 0) {
selectedToot-- selectedToot--
} }
@ -151,6 +158,10 @@ $(function ($) {
return false; return false;
} else if (e.code == "ArrowRight") { } else if (e.code == "ArrowRight") {
//right //right
if ($("#imagemodal").hasClass("open")) {
imgCont('prev');
return false;
}
if (selectedColumn < $(".tl-box").length - 1) { if (selectedColumn < $(".tl-box").length - 1) {
selectedColumn++ selectedColumn++
} }
@ -158,6 +169,9 @@ $(function ($) {
return false; return false;
} else if (e.code == "ArrowDown") { } else if (e.code == "ArrowDown") {
//down //down
if ($("#imagemodal").hasClass("open")) {
return false;
}
selectedToot++ selectedToot++
tootSelector(selectedColumn, selectedToot) tootSelector(selectedColumn, selectedToot)
return false; 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 () { $("#clear").click(function () {