Skip to content

Commit

Permalink
fix: removed unused close-button from midscroll (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
sannheim authored and pattan committed Aug 28, 2024
1 parent 9e5be11 commit 7d5f793
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/advantage/formats/midscroll.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { AdvantageFormat, AdvantageFormatName } from "../../types";
import styles from "./midscroll.css?raw";
import midscrollUICSS from "./midscroll-ui.css?raw";
import {
setDimensionsUntilAdvantageAdSlot,
resetDimensionsUntilAdvantageAdSlot
} from "./format-helper";
import logger from "../../utils/logging";

export const midscroll: AdvantageFormat = {
name: AdvantageFormatName.Midscroll,
Expand All @@ -14,25 +12,13 @@ export const midscroll: AdvantageFormat = {
setup: (wrapper, ad) => {
return new Promise((resolve) => {
wrapper.insertCSS(styles);

if (ad) {
setDimensionsUntilAdvantageAdSlot(ad);
}
if (ad) setDimensionsUntilAdvantageAdSlot(ad);

const uiContainer = document.createElement("div");
uiContainer.id = "ui-container";
const closeBtn = document.createElement("div");
closeBtn.id = "close";
uiContainer.appendChild(closeBtn);

wrapper.uiLayer.insertCSS(midscrollUICSS);
wrapper.uiLayer.changeContent(uiContainer);

closeBtn.addEventListener("click", () => {
logger.debug("Close button clicked");
wrapper.close();
});

resolve();
});
},
Expand Down

0 comments on commit 7d5f793

Please sign in to comment.