moved click handler to script files

This commit is contained in:
Miodec 2022-07-22 11:25:31 +02:00
parent 0f551b0eb9
commit 130eb17ae7
2 changed files with 17 additions and 4 deletions

View file

@ -1,5 +1,6 @@
import { activateAnalytics } from "../controllers/analytics-controller";
import { focusWords } from "../test/test-ui";
import * as Notifications from "../elements/notifications";
let visible = false;
@ -109,3 +110,18 @@ $(document).on("keypress", (e) => {
e.preventDefault();
}
});
$("#cookiePopup .cookie.ads .text-button").on("click", () => {
try {
//@ts-ignore
window.__tcfapi("displayConsentUi", 2, function () {
//
});
} catch (e) {
console.error("Failed to open ad consent UI");
Notifications.add(
"Failed to open Ad consent popup. Do you have an ad or cookie popup blocker enabled?",
-1
);
}
});

View file

@ -71,10 +71,7 @@
Our advertising partner may use cookies to deliver ads that are more
relevant to you.
</div>
<a
class="text-button"
onclick="window.__tcfapi('displayConsentUi', 2, function() {} );"
>
<a class="text-button">
Click to change your preferences on ad related cookies
</a>
</label>