From d9c9b2ab5ed6141d15516814a411c3c6886bf633 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 15 Jun 2017 00:14:13 +0200 Subject: [PATCH] modal: fix various recent regressions --- src/browser/js/app/widgets/containers/modal.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/browser/js/app/widgets/containers/modal.js b/src/browser/js/app/widgets/containers/modal.js index dc78057d..f8b76144 100644 --- a/src/browser/js/app/widgets/containers/modal.js +++ b/src/browser/js/app/widgets/containers/modal.js @@ -52,6 +52,7 @@ module.exports = class Modal extends Panel { constructor(options) { options.props.tabs = [] + options.props.scroll = true super(options) @@ -91,7 +92,7 @@ module.exports = class Modal extends Panel { } this.parentScroll = [0,0] - this.value = false + this.value = 0 this.init = false } @@ -100,21 +101,22 @@ module.exports = class Modal extends Panel { this.value = v ? 1 : 0 - if (!this.init) { + if (!this.init && this.value) { this.popup.find('.popup-title .popup-label').html(this.container.find('> .label span').html()) this.widget.detach().appendTo(this.popup.find('.popup-content')) } - this.popup.toggle(this.value) - this.container.toggleClass('on', this.value) - this.fixScrolling() + + this.popup.toggle(this.value?true:false) + this.container.toggleClass('on', this.value?true:false) + if (this.value) { $(window).resize() } - if (!this.init || this.value == true) this.fixStacking() + if (!this.init || this.value) this.fixStacking() if (!this.init) this.init = true if (options.send) this.sendValue() @@ -124,11 +126,11 @@ module.exports = class Modal extends Panel { fixScrolling(){ if (this.value) { - var c = this.container.parents('.tab, .modal-container > .panel').first() + var c = this.container.parents('.panel.tab').first() this.parentScroll = [c.scrollLeft(), c.scrollTop()] c.scrollTop(0).scrollLeft(0).css('overflow','hidden') } else { - this.container.parents('.tab, .modal-container > .panel').first().css('overflow','').scrollLeft(this.parentScroll[0]).scrollTop(this.parentScroll[1]) + this.container.parents('.panel.tab').first().css('overflow','').scrollLeft(this.parentScroll[0]).scrollTop(this.parentScroll[1]) } }