Browse Source

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

Felix Niklas 3 years ago
parent
commit
3b98e003f4
2 changed files with 2 additions and 9 deletions
  1. 2 1
      public/assets/form/form.css
  2. 0 8
      public/assets/form/form.js

+ 2 - 1
public/assets/form/form.css

@@ -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%;

+ 0 - 8
public/assets/form/form.js

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