modal: save/restore parent tab's scroll

This commit is contained in:
jean-emmanuel 2017-02-20 18:15:40 +01:00
parent 1f9d35b076
commit b840cca7ae

View file

@ -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])
}
}