mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +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)
|
||||
document.addEventListener('apiLoaded', () => {
|
||||
setNavbarMargin()
|
||||
const playPageObserver = new MutationObserver(() => {
|
||||
setNavbarMargin();
|
||||
});
|
||||
setNavbarMargin();
|
||||
const playPageObserver = new MutationObserver(setNavbarMargin);
|
||||
playPageObserver.observe($('ytmusic-app-layout'), { attributeFilter: ['player-page-open_', 'playerPageOpen_'] })
|
||||
})
|
||||
}, { once: true, passive: true })
|
||||
};
|
||||
|
||||
function setNavbarMargin() {
|
||||
$('ytmusic-app-layout').playerPageOpen_ ?
|
||||
$('#nav-bar-background').style.right = '0px' :
|
||||
$('#nav-bar-background').style.right = '12px';
|
||||
$('#nav-bar-background').style.right =
|
||||
$('ytmusic-app-layout').playerPageOpen_ ?
|
||||
'0px' :
|
||||
'12px';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user