Jelajahi Sumber

DQ - auto-grow textarea

Vijayakrishnan 3 tahun lalu
induk
melakukan
cd728379ca
1 mengubah file dengan 7 tambahan dan 0 penghapusan
  1. 7 0
      public/js/dq.js

+ 7 - 0
public/js/dq.js

@@ -18,6 +18,13 @@
 
                 runDQConditions($(this).closest('.dq-edit-container'));
             });
+        $(document)
+            .off('input.auto-grow', '.dq-edit-container textarea')
+            .on('input.auto-grow', '.dq-edit-container textarea', function() {
+                this.style.minHeight = "calc(1.5em + .5rem + 2px)";
+                this.style.height = "calc(1.5em + .5rem + 2px)";
+                this.style.height = (this.scrollHeight)+"px";
+            });
     };
 
     function resolveAtomicCondition(_condition, _dataMap) {