fix mobile search better
This commit is contained in:
parent
26d5ba386f
commit
dc90601e23
3 changed files with 10 additions and 0 deletions
|
@ -173,6 +173,10 @@ import {I18n} from "./i18n.js";
|
||||||
searchBox.parentElement!.classList.add("searching");
|
searchBox.parentElement!.classList.add("searching");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
const sideContainDiv = document.getElementById("sideContainDiv") as HTMLElement;
|
||||||
|
searchBox.onclick = () => {
|
||||||
|
sideContainDiv.classList.remove("hideSearchDiv");
|
||||||
|
};
|
||||||
searchX.onclick = () => {
|
searchX.onclick = () => {
|
||||||
if (searchX.classList.contains("svg-plainx")) {
|
if (searchX.classList.contains("svg-plainx")) {
|
||||||
markdown.txt = [];
|
markdown.txt = [];
|
||||||
|
|
|
@ -2845,6 +2845,7 @@ class Localuser {
|
||||||
for (const elm of htmls) elm.remove();
|
for (const elm of htmls) elm.remove();
|
||||||
}
|
}
|
||||||
const htmls: HTMLElement[] = [];
|
const htmls: HTMLElement[] = [];
|
||||||
|
sideContainDiv.classList.remove("hideSearchDiv");
|
||||||
for (const message of messages) {
|
for (const message of messages) {
|
||||||
if (channel !== message.channel) {
|
if (channel !== message.channel) {
|
||||||
channel = message.channel;
|
channel = message.channel;
|
||||||
|
@ -2857,6 +2858,7 @@ class Localuser {
|
||||||
const html = message.buildhtml(undefined, true);
|
const html = message.buildhtml(undefined, true);
|
||||||
html.addEventListener("click", async () => {
|
html.addEventListener("click", async () => {
|
||||||
try {
|
try {
|
||||||
|
sideContainDiv.classList.add("hideSearchDiv");
|
||||||
await message.channel.focus(message.id);
|
await message.channel.focus(message.id);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
|
@ -2721,6 +2721,10 @@ fieldset input[type="radio"] {
|
||||||
#sideContainDiv.searchDiv {
|
#sideContainDiv.searchDiv {
|
||||||
right: 0;
|
right: 0;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
transition: transform 0.2s;
|
||||||
|
}
|
||||||
|
.hideSearchDiv {
|
||||||
|
transform: translate(100%);
|
||||||
}
|
}
|
||||||
#page:has(#maintoggle:checked) #maintoggleicon {
|
#page:has(#maintoggle:checked) #maintoggleicon {
|
||||||
rotate: 180deg;
|
rotate: 180deg;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue