modal: save/restore parent tab's scroll
This commit is contained in:
parent
1f9d35b076
commit
b840cca7ae
1 changed files with 6 additions and 2 deletions
|
|
@ -50,6 +50,8 @@ module.exports = class Modal extends Panel {
|
|||
this.setValue(!this.value)
|
||||
})
|
||||
|
||||
this.parentScroll = [0,0]
|
||||
|
||||
}
|
||||
|
||||
setValue(v) {
|
||||
|
|
@ -70,9 +72,11 @@ module.exports = class Modal extends Panel {
|
|||
|
||||
fixScrolling(){
|
||||
if (this.value) {
|
||||
this.container.parents('.tab').first().css('overflow','hidden')
|
||||
var c = this.container.parents('.tab').first()
|
||||
this.parentScroll = [c.scrollLeft(), c.scrollTop()]
|
||||
c.scrollTop(0).scrollLeft(0).css('overflow','hidden')
|
||||
} else {
|
||||
this.container.parents('.tab').first().css('overflow','')
|
||||
this.container.parents('.tab').first().css('overflow','').scrollLeft(this.parentScroll[0]).scrollTop(this.parentScroll[1])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue