Pārlūkot izejas kodu

Add multi - RTE support subj and plan

Vijayakrishnan 3 gadi atpakaļ
vecāks
revīzija
6f7d4794ed

+ 13 - 0
public/css/style.css

@@ -3365,6 +3365,7 @@ body.forced-masking #mask {
 .stag-sheet tbody tr td {
     padding: 0;
     background: #fff;
+    cursor: text;
 }
 .stag-sheet tbody tr td input,
 .stag-sheet tbody tr td textarea {
@@ -3384,6 +3385,18 @@ body.forced-masking #mask {
 .stag-sheet tbody tr td textarea:focus-visible{
     border: 1px solid steelblue;
 }
+.mcp-theme-1 .stag-sheet .ql-container {
+    border: 0;
+}
+.mcp-theme-1 .stag-sheet .ql-editor[contenteditable] {
+    min-height: 28px;
+    border: 1px solid transparent;
+    padding: 3px;
+}
+.mcp-theme-1 .stag-sheet .ql-editor[contenteditable]:focus {
+    min-height: 28px;
+    border: 1px solid steelblue;
+}
 .note-container .summary-container p {
     margin-top: 0 !important;
     margin-bottom: 0 !important;

+ 9 - 5
resources/views/app/patient/wizard-partials/add-multiple-pre-existing.blade.php

@@ -102,16 +102,20 @@
                         <input type="text" key="organization" bucket="data">
                     </td>
                 @endif
-                <td class="p-0">
-                    <textarea rows="1" key="value" bucket="childReviewData"></textarea>
-                </td>
                 @if($label === 'medication')
                     <td class="p-0">
-                        <textarea rows="1" key="experience" bucket="childReviewData"></textarea>
+                        <textarea rows="1" key="value" bucket="childReviewData"></textarea>
+                    </td>
+                    <td class="p-0">
+                        <div note-rte class="rte-holder" key="experience" bucket="childReviewData"></div>
+                    </td>
+                @else
+                    <td class="p-0">
+                        <div note-rte class="rte-holder" key="value" bucket="childReviewData"></div>
                     </td>
                 @endif
                 <td class="p-0">
-                    <textarea rows="1" key="value" bucket="childPlanData"></textarea>
+                    <div note-rte class="rte-holder" key="value" bucket="childPlanData"></div>
                 </td>
                 <td class="p-0">
                     <input type="date" key="start_date" bucket="data">

+ 13 - 1
resources/views/app/patient/wizard-partials/common-script.blade.php

@@ -870,6 +870,9 @@ function generateData(_parentSegment) {
         $(this).find('input, textarea').each(function() {
             line[$(this).attr('bucket')][$(this).attr('key')] = this.value;
         });
+        $(this).find('[note-rte][key][bucket]').each(function() {
+            line[$(this).attr('bucket')][$(this).attr('key')] = $(this).find('.ql-editor[contenteditable]').first().html();
+        });
         line.data = JSON.stringify(line.data);
         line.childReviewData = JSON.stringify(line.childReviewData);
         line.childPlanData = JSON.stringify(line.childPlanData);
@@ -924,6 +927,16 @@ parentSegment
 
     });
 
+parentSegment
+    .off('click', '.stag-sheet tbody td')
+    .on('click', '.stag-sheet tbody td', function(_e) {
+        let focusable = $(this).find('input, textarea, .ql-editor[contenteditable]').first();
+        if(!focusable.is(':focus')) {
+            focusable.focus();
+            return false;
+        }
+    });
+
 parentSegment
     .off('click.delete-line', '.stag-sheet .delete-line')
     .on('click.delete-line', '.stag-sheet .delete-line', function() {
@@ -962,7 +975,6 @@ parentSegment
              if(!isEmptyRow) numEmptyRows--;
              else emptyRows.push(this);
         });
-        debugger
         if(numEmptyRows > 0) {
             if(numEmptyRows === numRows && numRows === 1) return false; // if only 1 row and all empty in that - ignore and stop
             else { // else clear empty rows