fix: render dates in quotes with long text
This commit is contained in:
parent
b493b2ade8
commit
ee2f7c7cbb
1 changed files with 7 additions and 3 deletions
|
@ -163,7 +163,7 @@ media_theme_pref();
|
|||
}
|
||||
});
|
||||
|
||||
self.define("clean_poll_date_codes", ({ $ }) => {
|
||||
self.define("clean_poll_date_codes", async ({ $ }) => {
|
||||
for (const element of Array.from(
|
||||
document.querySelectorAll(".poll_date"),
|
||||
)) {
|
||||
|
@ -183,7 +183,7 @@ media_theme_pref();
|
|||
element.setAttribute("title", then.toLocaleString());
|
||||
|
||||
const pretty =
|
||||
$.rel_date(then)
|
||||
(await $.rel_date(then))
|
||||
.replaceAll(" minutes ago", "m")
|
||||
.replaceAll(" minute ago", "m")
|
||||
.replaceAll(" hours ago", "h")
|
||||
|
@ -409,9 +409,13 @@ media_theme_pref();
|
|||
}
|
||||
});
|
||||
|
||||
self.define("hooks::long", (_, element, full_text) => {
|
||||
self.define("hooks::long", ({ $ }, element, full_text) => {
|
||||
element.classList.remove("hook:long.hidden_text");
|
||||
element.innerHTML = full_text;
|
||||
|
||||
$.clean_date_codes();
|
||||
$.clean_poll_date_codes();
|
||||
$.link_filter();
|
||||
});
|
||||
|
||||
self.define("hooks::long_text.init", (_) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue