dont focus search bars on mobile since it triggers the keyboard which can be annoying
parent
7c01b13adf
commit
952fe68ea6
|
@ -433,3 +433,11 @@ function logout(t) {
|
||||||
location.href = '/'
|
location.href = '/'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
|
||||||
|
function focusSearchBar(element)
|
||||||
|
{
|
||||||
|
if (width >= 768) {
|
||||||
|
element.focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -266,7 +266,7 @@ function switchEmojiTab(e)
|
||||||
const className = e.currentTarget.dataset.className;
|
const className = e.currentTarget.dataset.className;
|
||||||
|
|
||||||
emojiSearchBarDOM.value = "";
|
emojiSearchBarDOM.value = "";
|
||||||
emojiSearchBarDOM.focus();
|
focusSearchBar(emojiSearchBarDOM);
|
||||||
emojiNotFoundDOM.hidden = true;
|
emojiNotFoundDOM.hidden = true;
|
||||||
|
|
||||||
// Special case: favorites
|
// Special case: favorites
|
||||||
|
@ -567,11 +567,11 @@ function loadEmojis(inputTargetIDName)
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('emojiModal').addEventListener('shown.bs.modal', function () {
|
document.getElementById('emojiModal').addEventListener('shown.bs.modal', function () {
|
||||||
emojiSearchBarDOM.focus();
|
focusSearchBar(emojiSearchBarDOM);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
emojiSearchBarDOM.focus();
|
focusSearchBar(emojiSearchBarDOM);
|
||||||
}, 200);
|
}, 200);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
emojiSearchBarDOM.focus();
|
focusSearchBar(emojiSearchBarDOM);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,12 +15,12 @@ function insertGIF(url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('gifModal').addEventListener('shown.bs.modal', function () {
|
document.getElementById('gifModal').addEventListener('shown.bs.modal', function () {
|
||||||
gifSearchBar.focus();
|
focusSearchBar(gifSearchBar);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
gifSearchBar.focus();
|
focusSearchBar(gifSearchBar);
|
||||||
}, 200);
|
}, 200);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
gifSearchBar.focus();
|
focusSearchBar(gifSearchBar);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue