Przeglądaj źródła

RPM UI - delay load tree node counts

Vijayakrishnan 3 lat temu
rodzic
commit
333ef074f2

+ 8 - 6
resources/views/app/practice-management/remote-monitoring-tree.blade.php

@@ -72,13 +72,15 @@ if(!@$rc) {
 <script>
     (function() {
         function init() {
-            $('#remote-monitoring-tree .rm-count').each(function() {
-                let params = '?rc=' + $(this).attr('data-rc');
-                if($(this).is('[data-rc2]')) params += '&rc2=' + $(this).attr('data-rc2');
-                $.get('{{route('practice-management.remote-monitoring-count')}}?' + params, _data => {
-                    $(this).text('(' + _data + ')');
+            window.setTimeout(() => {
+                $('#remote-monitoring-tree .rm-count').each(function() {
+                    let params = '?rc=' + $(this).attr('data-rc');
+                    if($(this).is('[data-rc2]')) params += '&rc2=' + $(this).attr('data-rc2');
+                    $.get('{{route('practice-management.remote-monitoring-count')}}?' + params, _data => {
+                        $(this).text('(' + _data + ')');
+                    });
                 });
-            });
+            }, 250);
         }
         addMCInitializer('remote-monitoring-tree', init, '#remote-monitoring-tree')
     }).call(window);