Add close button

This commit is contained in:
Ajay Ramachandran
2021-07-29 18:34:31 -04:00
parent 1a855a6993
commit d0949452da
2 changed files with 27 additions and 4 deletions

View File

@@ -9,11 +9,23 @@ export interface ChatConfig {
}
export function openChat(config: ChatConfig): void {
const chat = document.createElement("iframe");
chat.src = "https://chat.sponsor.ajay.app/#" + utils.objectToURI("", config, false);
chat.classList.add("chatNotice");
const chat = document.createElement("div");
chat.classList.add("sbChatNotice");
chat.style.zIndex = "2000";
const iframe= document.createElement("iframe");
iframe.src = "https://chat.sponsor.ajay.app/#" + utils.objectToURI("", config, false);
chat.appendChild(iframe);
const closeButton = document.createElement("img");
closeButton.classList.add("sbChatClose");
closeButton.src = chrome.extension.getURL("icons/close.png");
closeButton.addEventListener("click", () => {
chat.remove();
closeButton.remove();
});
chat.appendChild(closeButton);
console.log(utils.objectToURI("", config, false))
const referenceNode = utils.findReferenceNode();