Skip to content

Commit

Permalink
Fix Spicetify tob-button CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiuth committed Feb 17, 2024
1 parent 5eec30e commit 596bc4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v1.1
- uses: microsoft/setup-msbuild@v2
- uses: actions/setup-node@v4
with:
node-version: 18
Expand Down
13 changes: 8 additions & 5 deletions Sprinkles/src/ui/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,23 @@ export default class UI {
}
// Lyrics page will delete topbar header
if (!topbarDiv.isConnected) {
let fwdButton = document.querySelector("[data-testid='top-bar-forward-button'], .main-topBar-forward");
let topbarContainer = fwdButton.parentElement;
topbarContainer.append(topbarDiv);
this.addTopbarButtons(topbarDiv);
}
});
//playlist context menus are delayed, so we need to observe subtrees too
bodyObs.observe(document.body, { childList: true, subtree: true });
}

private addTopbarButtons() {
let fwdButton = document.querySelector("[data-testid='top-bar-forward-button'], .main-topBar-forward");
private addTopbarButtons(existingDiv = undefined) {
let fwdButton = document.querySelector("[data-testid='top-bar-forward-button'], .main-topBar-forward, .main-topBar-responsiveForward");
let topbarContainer = fwdButton.parentElement;
let buttonClass = fwdButton.classList[0];

if (existingDiv) {
topbarContainer.append(existingDiv);
return;
}

let div = document.createElement("div");
div.className = "sgf-topbar-retractor";
div.innerHTML = `
Expand Down

0 comments on commit 596bc4e

Please sign in to comment.