Peter Muturi 7 tháng trước cách đây
mục cha
commit
fcf4a3fc92

+ 16 - 3
resources/views/app/my-account/admin/users/sub/messages.blade.php

@@ -199,11 +199,24 @@
                     toastr.error(msg);
                     return true;
                 }
+                function showInnerMask(){
+                    $('.msg-input textarea').css('background-color', '#fff !important');
+                    $('.msg-input textarea').prop('disabled', true);
+                    $('.msg-input button').prop('disabled', true);
+                    $('.msg-input i').removeClass('fa-paper-plane');
+                    $('.msg-input i').addClass('fa-circle-notch fa-spin ms-0');
+                  }
+                  function hideInnerMask(){
+                    $('.msg-input textarea').prop('disabled', false);
+                    $('.msg-input button').prop('disabled', false);
+                    $('.msg-input i').addClass('fa-paper-plane');
+                    $('.msg-input i').removeClass('fa-circle-notch fa-spin ms-0');
+                  }
 
                 function doSend(_elem) {
                     if (inProgress) return false;
                     inProgress = true;
-                    showMask();
+                    showInnerMask();
                     let text = $.trim(_elem.value);
                     let formData = new FormData();
                     formData.set('fromUserUid', '{{ $performer->user->uid }}');
@@ -222,7 +235,7 @@
 
                     if (!hasFiles && !text) { // either attachment or text or both should be there
                         inProgress = false;
-                        hideMask();
+                        hideInnerMask();
                         return false;
                     }
 
@@ -238,7 +251,7 @@
                         } else {
                             $('.im-input textarea').val('');
                             inProgress = false;
-                            hideMask();
+                            hideInnerMask();
                         }
                     });
                     return false;