mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
lint in-app-menu
This commit is contained in:
@ -17,16 +17,15 @@ module.exports = () => {
|
|||||||
|
|
||||||
// Increases the right margin of Navbar background when the scrollbar is visible to avoid blocking it (z-index doesn't affect it)
|
// Increases the right margin of Navbar background when the scrollbar is visible to avoid blocking it (z-index doesn't affect it)
|
||||||
document.addEventListener('apiLoaded', () => {
|
document.addEventListener('apiLoaded', () => {
|
||||||
setNavbarMargin()
|
setNavbarMargin();
|
||||||
const playPageObserver = new MutationObserver(() => {
|
const playPageObserver = new MutationObserver(setNavbarMargin);
|
||||||
setNavbarMargin();
|
|
||||||
});
|
|
||||||
playPageObserver.observe($('ytmusic-app-layout'), { attributeFilter: ['player-page-open_', 'playerPageOpen_'] })
|
playPageObserver.observe($('ytmusic-app-layout'), { attributeFilter: ['player-page-open_', 'playerPageOpen_'] })
|
||||||
})
|
}, { once: true, passive: true })
|
||||||
};
|
};
|
||||||
|
|
||||||
function setNavbarMargin() {
|
function setNavbarMargin() {
|
||||||
$('ytmusic-app-layout').playerPageOpen_ ?
|
$('#nav-bar-background').style.right =
|
||||||
$('#nav-bar-background').style.right = '0px' :
|
$('ytmusic-app-layout').playerPageOpen_ ?
|
||||||
$('#nav-bar-background').style.right = '12px';
|
'0px' :
|
||||||
|
'12px';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user