Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
dermatthes committed Mar 30, 2024
1 parent 11dedb0 commit 32595a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@leuffen/liscom-loader",
"version": "1.0.7",
"version": "1.0.8",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.js",
Expand Down
8 changes: 7 additions & 1 deletion src/loader/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ export function initLoader() {
// Cancel interval
clearInterval(interval);

let img = document.querySelector("img")?.cloneNode(true) as HTMLImageElement;

let img = document.querySelector("img.loader-image")?.cloneNode(true) as HTMLImageElement;
if (img === undefined) {
img = document.querySelector("img")?.cloneNode(true) as HTMLImageElement;
}

if (img === undefined) {
console.warn("[liscom-loader] No image found to use as loader.");
return;
}
img.classList.remove("d-none");

let loader = ka_create_element("div", {class: "loader"});
let loaderImg = ka_create_element("div", {class: "loader-img"}, [img], loader);
img.setAttribute("class", "");
Expand Down

0 comments on commit 32595a9

Please sign in to comment.