[FIX] web: DomainSelectorDialog: prevent overflow

The DomainSelectorDialog behaves differently from classical dialogs
in terms of height and overflow: (1) its height can be larger than
the screen height, and (2) its content is never scrollable
(overflow visible).

However, before this rev., the 'height: auto' rule ensuring (1)
didn't apply, so the dialog's height was limited to the screen's
height, and when it had to much content to display, it overflowed.

It didn't work because the code tried to apply the rule too soon,
so the .modal-dialog element was not yet available.

Fixes #23292
This commit is contained in:
Aaron Bohy
2018-02-28 12:04:33 +01:00
parent 26325dc943
commit d4126f7278
@@ -40,7 +40,11 @@ return Dialog.extend({
this.domainSelector = new DomainSelector(this, model, domain, options);
},
start: function () {
this.$el.css("overflow", "visible").closest(".modal-dialog").css("height", "auto"); // This restores default modal height (bootstrap) and allows field selector to overflow
var self = this;
this.opened().then(function () {
// this restores default modal height (bootstrap) and allows field selector to overflow
self.$el.css('overflow', 'visible').closest('.modal-dialog').css('height', 'auto');
});
return $.when(
this._super.apply(this, arguments),
this.domainSelector.appendTo(this.$el)