Эх сурвалжийг харах

Ticket desc => resizable+auto-grow textarea

Vijayakrishnan 3 жил өмнө
parent
commit
265b9cb774

+ 15 - 0
resources/views/app/patient/tickets.blade.php

@@ -1028,6 +1028,21 @@
                             @endif
                         @endif
 
+                        function autoGrow(_ta) {
+                            _ta.style.minHeight = "46px";
+                            _ta.style.height = "46px";
+                            _ta.style.height = (_ta.scrollHeight + 10)+"px";
+                        }
+                        $(document)
+                            .off('input.auto-grow', '#ticketsApp textarea.auto-grow')
+                            .on('input.auto-grow', '#ticketsApp textarea.auto-grow', function() {
+                                autoGrow(this);
+                            });
+                        $(document)
+                            .off('focus.auto-grow', '#ticketsApp textarea.auto-grow')
+                            .on('focus.auto-grow', '#ticketsApp textarea.auto-grow', function() {
+                                autoGrow(this);
+                            });
                     }
                 })
             }

+ 1 - 1
resources/views/app/patient/tickets/other.blade.php

@@ -63,7 +63,7 @@
                 </div>
                 <div class="mb-2">
                     <label class="text-sm text-secondary mb-1">Description</label>
-                    <input type="text" v-model="otherPopupItem.data.description" placeholder="Description" class="form-control form-control-sm">
+                    <textarea type="text" v-model="otherPopupItem.data.description" placeholder="Description" class="form-control form-control-sm resize-v auto-grow" rows="2"></textarea>
                 </div>
                 <div class="mb-2">
                     <label class="text-sm text-secondary mb-1">Memo</label>