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;
z-index: 999;
overflow: auto;
overscroll-behavior: contain;
}
.zammad-form-modal:before {
@ -47,7 +48,7 @@
}
.zammad-form-modal-backdrop {
position: absolute;
position: fixed;
left: 0;
top: 0;
width: 100%;

View file

@ -274,7 +274,6 @@ $(function() {
_this.render()
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
Plugin.prototype.render = function(e) {
var _this = this
@ -442,7 +435,6 @@ $(function() {
// append modal to body
else {
$('body').append($element)
this.resizeModalBackdrop()
}
}