Sfoglia il codice sorgente

Perf: Strict scope mc initers

Vijayakrishnan 3 anni fa
parent
commit
ce2af22da8

+ 1 - 1
config/app.php

@@ -65,7 +65,7 @@ return [
 
     'hrm2_url' => env('HRM2_URL'),
 
-    'asset_version' => 11,
+    'asset_version' => 12,
 
     'temp_dir' => env('TEMP_DIR'),
 

+ 4 - 2
resources/views/app/patient/care-month/_matrix.blade.php

@@ -26,6 +26,8 @@ foreach ($days as $k => $day) {
 }
 
 ?>
+
+<div id="cm-matrix-{{$patient->id}}">
 <div class="d-flex align-items-baseline">
     <a class="font-weight-bold" href="#" tab-link="matrix">Care Month Matrix</a>
     <span class="mx-2 text-secondary text-sm">|</span>
@@ -264,7 +266,7 @@ foreach ($days as $k => $day) {
 <div class="my-3 border p-3 d-none cm-tab" tab-key="bp-summary">
     @include('app.patient.vitals-settings.bp-management-summary')
 </div>
-
+</div>
 <script>
     (function() {
         function init() {
@@ -279,6 +281,6 @@ foreach ($days as $k => $day) {
                     return false;
                 });
         }
-        addMCInitializer('cm-matrix-{{$patient->id}}', init);
+        addMCInitializer('cm-matrix-{{$patient->id}}', init, '#cm-matrix-{{$patient->id}}');
     }).call(window);
 </script>

+ 3 - 2
resources/views/app/patient/claims-resolver.blade.php

@@ -53,6 +53,7 @@
         if($note->is_claim_closed) $totalNotesWithClaimingClosed++;
     }
     ?>
+    <div id="claims-resolver">
     <h2><strong>Numbers:</strong></h2>
     <table class="table table-sm table-striped">
         <tr>
@@ -413,7 +414,7 @@
         </tbody>
     </table>
     </div>
-
+    </div>
     <script>
         (function() {
             function init() {
@@ -423,7 +424,7 @@
                     scrollX: true
                 });
             }
-            addMCInitializer('claims-resolver', init);
+            addMCInitializer('claims-resolver', init, '#claims-resolver');
         }).call(window);
     </script>
 

+ 1 - 1
resources/views/app/patient/note/dashboard_script.blade.php

@@ -502,6 +502,6 @@
                 $('.note-template-output-text:visible').first().html(lines.join(''));
             }
 
-            addMCInitializer('note-single', init);
+            addMCInitializer('note-single', init, '#note-single-header');
         })();
     </script>

+ 1 - 1
resources/views/app/patient/note/note-segment-list.blade.php

@@ -1,4 +1,4 @@
-<div class="segments-list">
+<div class="segments-list" id="note-segments-list">
     @foreach($note->segments as $segment)
         @include('app.patient.note.segment')
     @endforeach

+ 1 - 1
resources/views/app/patient/note/segment_script.blade.php

@@ -305,7 +305,7 @@
              */
         }
 
-        addMCInitializer('note-segments-list', init);
+        addMCInitializer('note-segments-list', init, '#note-segments-list');
 
     })();
 </script>

+ 3 - 1
resources/views/app/patient/notes.blade.php

@@ -2,6 +2,7 @@
 
 @section('inner-content')
 
+    <div id="notes-list-{{$patient->id}}">
     <div class="pt-2 d-flex align-items-start">
         <h6 class="my-0 text-secondary d-flex align-items-center w-100">
             <span class="font-weight-bold text-secondary">Notes</span>
@@ -215,6 +216,7 @@
         @endforeach
         </tbody>
     </table>
+    </div>
     <script>
         (function() {
             function initNotesList() {
@@ -270,7 +272,7 @@
                     }
                 });
             }
-            addMCInitializer('notes-list', initNotesList);
+            addMCInitializer('notes-list', initNotesList, '#notes-list-{{$patient->id}}');
         })();
     </script>
 @endsection

+ 2 - 2
resources/views/app/patient/partials/appointment-confirmation.blade.php

@@ -1,4 +1,4 @@
-<div class="d-flex">
+<div class="d-flex" id="appointment-confirmation">
     <div class="flex-grow-1">
         @if($appointment->status === 'CREATED' && !$appointment->latest_confirmation_request_at && !$appointment->latest_confirmation_decision_at)
             <b class="text-warning-mellow">Not requested yet</b>
@@ -65,6 +65,6 @@
                     container.load('/appointment-confirmation-history/' + $(this).attr('data-uid'));
                 });
         }
-        addMCInitializer('appointment-confirmation', init);
+        addMCInitializer('appointment-confirmation', init, '#appointment-confirmation');
     }).call(window);
 </script>

+ 1 - 1
resources/views/app/patient/supply-orders.blade.php

@@ -537,7 +537,7 @@
                 }
 
             }
-            addMCInitializer('patient-supply-orders', init);
+            addMCInitializer('patient-supply-orders', init, '#patient-supply-orders');
         }).call(window);
     </script>
 @endsection