fix (ipad): ipad 14 issue

This commit is contained in:
MickaelK 2024-07-23 00:13:33 +10:00
parent 4efdeb9c97
commit 233f9c12fe
3 changed files with 22 additions and 2 deletions

View file

@ -15,6 +15,7 @@ export default async function main() {
// setup_sw(), // TODO
setup_blue_death_screen(),
setup_history(),
setup_polyfill(),
]);
await Promise.all([ // procedure with dependency on config
@ -117,3 +118,9 @@ async function setup_history() {
async function setup_title() {
document.title = window.CONFIG.name || "Filestash";
}
async function setup_polyfill() {
if (!("replaceChildren" in document.body)) {
await loadJS(import.meta.url, "../lib/polyfill.js");
}
}

View file

@ -3,14 +3,16 @@ import { animate, slideYIn } from "../lib/animate.js";
import assert from "../lib/assert.js";
import { loadCSS } from "../helpers/loader.js";
await loadCSS(import.meta.url, "./dropdown.css");
export default class ComponentDropdown extends HTMLDivElement {
constructor() {
super();
this.render();
}
async connectedCallback() {
await loadCSS(import.meta.url, "./dropdown.css");
}
static get observedAttributes() {
return ["options"];
}

View file

@ -0,0 +1,11 @@
Document.prototype.replaceChildren ||= replaceChildren;
DocumentFragment.prototype.replaceChildren ||= replaceChildren;
Element.prototype.replaceChildren ||= replaceChildren;
function replaceChildren(...new_children) {
const { childNodes } = this;
while (childNodes.length) {
childNodes[0].remove();
}
this.append(...new_children);
}