mirror of
https://github.com/Steffo99/tidebringer-firefox.git
synced 2025-01-05 05:29:46 +00:00
Move buttons to below the "add items" list
This commit is contained in:
parent
a560543edc
commit
1f67db9258
2 changed files with 17 additions and 5 deletions
|
@ -1,3 +1,7 @@
|
|||
#tidebringer-container {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.tidebringer-running {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ async function addItemToCollection(itemElement) {
|
|||
}
|
||||
|
||||
async function addAllSubscribedToCollection() {
|
||||
const buttonElement = document.querySelector("#tidebringer-add-all-subscribed");
|
||||
const buttonElement = document.querySelector("#tidebringer-btn-add-all-subscribed");
|
||||
buttonElement.className += " tidebringer-running";
|
||||
|
||||
const itemElements = document.querySelectorAll(".itemChoice");
|
||||
|
@ -42,16 +42,24 @@ async function addAllSubscribedToCollection() {
|
|||
|
||||
function tidebringer() {
|
||||
console.log("%c Tidebringer %chttps://github.com/Steffo99/tidebringer-firefox", "background-color: black; color: #a0f3f6;");
|
||||
const buttonsLine = document.querySelector(".collectionAddItemsTitle");
|
||||
|
||||
const whereTheContainerShouldBePlaced = document.querySelector(".collectionAddItemsSection");
|
||||
if(!whereTheContainerShouldBePlaced) return
|
||||
|
||||
const container = document.createElement("div")
|
||||
container.id = "tidebringer-container"
|
||||
whereTheContainerShouldBePlaced.appendChild(container)
|
||||
|
||||
const addAllSubscribedButton = document.createElement("button");
|
||||
addAllSubscribedButton.className = "btn_darkblue_white_innerfade btn_medium"
|
||||
addAllSubscribedButton.addEventListener("click", addAllSubscribedToCollection);
|
||||
addAllSubscribedButton.id = "tidebringer-add-all-subscribed";
|
||||
addAllSubscribedButton.id = "tidebringer-btn-add-all-subscribed";
|
||||
const addAllSubscribedSpan = document.createElement("span");
|
||||
const addAllSubscribedText = document.createTextNode("Add all subscribed elements");
|
||||
addAllSubscribedSpan.appendChild(addAllSubscribedText);
|
||||
addAllSubscribedButton.appendChild(addAllSubscribedSpan);
|
||||
buttonsLine.appendChild(addAllSubscribedButton);
|
||||
|
||||
container.appendChild(addAllSubscribedButton);
|
||||
}
|
||||
|
||||
tidebringer();
|
Loading…
Reference in a new issue