sidepanel: prevent focus forced scroll when closed

This commit is contained in:
jean-emmanuel 2019-01-07 06:40:06 +01:00
parent 843bc0a91d
commit d044601608
4 changed files with 19 additions and 3 deletions

View file

@ -12,6 +12,8 @@
- added notifications
- widgets
- `matrices`: **new** `patchbay` widget
- bug fixes
- prevent layout break when hitting tab with sidepanel closed and editor enabled
## 0.40.5

View file

@ -20,7 +20,7 @@
<body>
<div id="container"></div>
<div id="sidepanel"></div>
<div id="sidepanel" class="hide"></div>
<div id="notifications"></div>
</body>

View file

@ -227,8 +227,12 @@ function sidepanelOpen() {
sidepaneLock = true
DOM.each(document, '#open-toggle, #sidepanel', (el)=>{
el.classList.add('sidepanel-open')
DOM.get('#sidepanel')[0].classList.remove('hide')
setTimeout(function(){
DOM.each(document, '#open-toggle, #sidepanel', (el)=>{
el.classList.add('sidepanel-open')
})
})
setTimeout(function(){
@ -249,6 +253,10 @@ function sidepanelClose() {
el.classList.remove('sidepanel-open')
})
setTimeout(function(){
DOM.get('#sidepanel')[0].classList.add('hide')
}, 250)
setTimeout(function(){
DOM.dispatchEvent(window, 'resize')
}, 25)

View file

@ -27,6 +27,12 @@
opacity: 1;
}
&.hide {
z-index: -1;
pointer-events: none;
margin-right: 0;
}
.navigation {
margin-bottom:2rem;
margin-left: 0;