Form: refactor backdrop resizing – no more js needed; also resizes when textarea resizes

This commit is contained in:
Felix Niklas 2021-06-29 12:38:39 +02:00 committed by Thorsten Eckel
parent 1ddb63f02e
commit 3b98e003f4
2 changed files with 2 additions and 9 deletions

View file

@ -36,6 +36,7 @@
text-align: center; text-align: center;
z-index: 999; z-index: 999;
overflow: auto; overflow: auto;
overscroll-behavior: contain;
} }
.zammad-form-modal:before { .zammad-form-modal:before {
@ -47,7 +48,7 @@
} }
.zammad-form-modal-backdrop { .zammad-form-modal-backdrop {
position: absolute; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
width: 100%; width: 100%;

View file

@ -274,7 +274,6 @@ $(function() {
_this.render() _this.render()
return true return true
}) })
window.addEventListener('resize', _this.resizeModalBackdrop.bind(_this));
} }
} }
@ -373,12 +372,6 @@ $(function() {
} }
} }
Plugin.prototype.resizeModalBackdrop = function() {
if (this.$modal) {
this.$modal.find('.js-zammad-form-modal-backdrop').css('height', this.$modal.prop('scrollHeight'));
}
}
// render form // render form
Plugin.prototype.render = function(e) { Plugin.prototype.render = function(e) {
var _this = this var _this = this
@ -442,7 +435,6 @@ $(function() {
// append modal to body // append modal to body
else { else {
$('body').append($element) $('body').append($element)
this.resizeModalBackdrop()
} }
} }