ソースを参照

Auto-refresh disclaimers on updating 'method'

Vijayakrishnan 3 年 前
コミット
19cf2c13a0
1 ファイル変更17 行追加11 行削除
  1. 17 11
      resources/views/app/patient/note/dashboard.blade.php

+ 17 - 11
resources/views/app/patient/note/dashboard.blade.php

@@ -306,7 +306,7 @@
                     @if(!$note->is_signed_by_hcp || $pro->pro_type === 'ADMIN')
                         <div moe class="ml-auto">
                             <a href="" show start><i class="fa fa-edit"></i></a>
-                            <form url="/api/note/updateMethod">
+                            <form url="/api/note/updateMethod" {!! $isVisitTemplateBased && $note->visitTemplate->internal_name === 'soap_visit' ? 'hook="onNoteMethodUpdate"' : '' !!}>
                                 <input type="hidden" name="uid" value="{{$note->uid}}">
                                 <div class="mb-2">
                                     <select name="method" class="form-control form-control-sm note-method-select" required>
@@ -2747,15 +2747,21 @@
             addMCInitializer('note-tree', init, '#note-lhs-tree');
         })();
     </script>
-    <script>
-        (function() {
-            function init() {
-                initVSplitter('stag-note', $('.note-left-panel'), $('.note-right-panel'));
-                initStagScrollbar(34);
-            }
-            addMCInitializer('note-splitter', init, '#note-single-header');
-        })();
-    </script>
+        @if($isVisitTemplateBased && $note->visitTemplate->internal_name === 'soap_visit')
+        <script>
+            (function() {
+                function init() {
+                    initVSplitter('stag-note', $('.note-left-panel'), $('.note-right-panel'));
+                    initStagScrollbar(34);
+                    addMCHook('onNoteMethodUpdate', function() {
+                        $('.visit-segment[data-segment-template-name="disclaimers"]').find('.refresh-segment').trigger('click');
+                        fastReload();
+                    });
+                }
+                addMCInitializer('soap-visit', init, '#note-single-header');
+            })();
+        </script>
+        @endif
     @endif
 @endsection
 @if(!$isVisitTemplateBased)
@@ -2797,7 +2803,7 @@
             </div>
         </div>
     </div>
-                <script>
+    <script>
         (function() {
             function initSectionsWidget() {
                 var allSections = <?= json_encode($allSections) ?>;