mirror of
https://github.com/morpheusthewhite/spicetify-themes.git
synced 2024-11-22 02:42:54 +01:00
fix(Turntable): correctly close the Full App Display and the config popup window
Fix the Spicetify's bug: - prevent close the Full App Display when quickly click the control button - correctly close the popup window when switch config
This commit is contained in:
parent
5cb616a78c
commit
8deecbb492
@ -20,15 +20,33 @@ window.addEventListener("load", rotateTurntable = () => {
|
||||
}
|
||||
}
|
||||
|
||||
handleRotate();
|
||||
function handleFadDblclick() {
|
||||
const fadControlsBtns = document.querySelectorAll("#fad-controls button");
|
||||
|
||||
for (const fadControl of fadControlsBtns) {
|
||||
fadControl.addEventListener("dblclick", event => event.stopPropagation());
|
||||
}
|
||||
}
|
||||
|
||||
function handleInitalStatus(genericModal) {
|
||||
if (genericModal) {
|
||||
genericModal.remove();
|
||||
}
|
||||
|
||||
handleRotate();
|
||||
handleFadDblclick();
|
||||
}
|
||||
|
||||
handleInitalStatus();
|
||||
|
||||
Spicetify.Player.addEventListener("onplaypause", () => handleRotate(true));
|
||||
|
||||
fullAppDisplay.addEventListener("contextmenu", () => {
|
||||
const genericModal = document.querySelector("generic-modal");
|
||||
const configSwitchBtns = document.querySelectorAll("#popup-config-container button.switch");
|
||||
|
||||
for (const configSwitch of configSwitchBtns) {
|
||||
configSwitch.addEventListener("click", () => handleRotate());
|
||||
configSwitch.addEventListener("click", () => handleInitalStatus(genericModal));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user