Fix update message stacking

This commit is contained in:
Send_Nukez 2021-10-28 18:36:27 +02:00 committed by GitHub Action
parent 04c93fa39b
commit 850822db80
3 changed files with 25 additions and 6 deletions

View file

@ -0,0 +1,2 @@
Fixed:
- Update message stacking

View file

@ -651,18 +651,23 @@ waitForElement([".main-userWidget-box"], ([userWidget]) => {
return response.json();
})
.then((data) => {
const upd = document.createElement("div");
upd.classList.add("ellipsis-one-line", "main-type-finale");
upd.setAttribute("title", `Changes: ${data.name}`);
upd.style.setProperty("color", "var(--spice-button-active)");
let upd;
if (!document.getElementById("dribbblish-update")) {
upd = document.createElement("div");
upd.id = "dribbblish-update";
//upd.setAttribute("title", `Changes: ${data.name}`);
userWidget.append(upd);
userWidget.classList.add("update-avail");
} else {
upd = document.getElementById("dribbblish-update");
}
if (process.env.DRIBBBLISH_VERSION == "Dev") {
upd.innerText = "Dev version!";
} else if (data.tag_name > process.env.DRIBBBLISH_VERSION) {
upd.innerText = `Theme UPD v${data.tag_name} avail.`;
new Spicetify.Menu.Item("Update Dribbblish", false, () => window.open("https://github.com/JulienMaille/dribbblish-dynamic-theme/releases/latest", "_blank")).register();
}
userWidget.append(upd);
userWidget.classList.add("update-avail");
})
.catch((err) => {
// Do something for an error here

View file

@ -812,6 +812,18 @@ li.GlueDropTarget {
pointer-events: none;
}
#dribbblish-update {
color: var(--spice-button-active);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 11px;
font-weight: 400;
letter-spacing: normal;
line-height: 16px;
text-transform: none;
}
/** Rearrange player bar */
.main-nowPlayingBar-left {
order: 1;