Jelajahi Sumber

Merge branch 'dev' of rav.triplestart.com:jmudaka/stagfe2 into master

Josh 4 tahun lalu
induk
melakukan
d8d33c28b8

+ 4 - 3
public/js/mc-init.js

@@ -1,8 +1,9 @@
 window.mcInitializers = {};
 window.addMCInitializer = function(_name, _func, _container) {
-    // if(!!window.mcInitializers[_name]) {
-    //     console.warn('ALIX initializer ' + _name + ' exists. Will overwrite.');
-    // }
+    if(!!window.mcInitializers[_name]) {
+        // console.warn('ALIX initializer ' + _name + ' exists. Will overwrite.');
+        delete window.mcInitializers[_name];
+    }
     window.mcInitializers[_name] = {
         func: _func,
         container: _container

+ 4 - 1
resources/views/app/patient/canvas-sections/dx/form.blade.php

@@ -227,8 +227,11 @@ $formID = rand(0, 100000);
                 methods: {
                     includeAllChanged: function() {
                         for (let i = 0; i < this.items.length; i++) {
-                            this.inclusion[i] = this.includeAll;
+                            this.inclusion[i] = this.includeAll; // NOTE: this does not trigger a watch event
                         }
+                        $('#dxSection').find('[name="data"]').val(JSON.stringify({ // trigger mutation on select-all
+                            items: this.cleanArray(this.items)
+                        }));
                     },
                     includeChanged: function() {
                         let all = true;

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

@@ -132,17 +132,17 @@
 
         function initChangeListener(_elem) {
             new MutationObserver(debounce(function() {
-                    if(_elem.closest('.note-section').is('.edit')) {
-                        // console.log('ALIX: In edit mode. Auto-saving', _elem.closest('.note-section').attr('data-section-template-name'))
-                        doSave(_elem.closest('.note-section'))
-                    }
-                    else {
-                        // console.log('ALIX: Not in edit mode. Not auto-saving', _elem.closest('.note-section').attr('data-section-template-name'))
-                    }
-                }, 250))
-                .observe(_elem[0], {
-                    attributes: true
-                });
+                if(_elem.closest('.note-section').is('.edit')) {
+                    // console.log('ALIX: In edit mode. Auto-saving', _elem.closest('.note-section').attr('data-section-template-name'))
+                    doSave(_elem.closest('.note-section'))
+                }
+                else {
+                    // console.log('ALIX: Not in edit mode. Not auto-saving', _elem.closest('.note-section').attr('data-section-template-name'))
+                }
+            }, 250))
+            .observe(_elem[0], {
+                attributes: true
+            });
         }
 
         addMCInitializer('note-sections-list', init);