]> _ Git - cubist_cms-back.git/commitdiff
#2834
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 14 Jun 2019 10:33:57 +0000 (12:33 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 14 Jun 2019 10:33:57 +0000 (12:33 +0200)
src/resources/views/when.blade.php

index dcc34fa56a1baf732ee39253c0589b3914d70915..c34f7da120346834bf3d6e7b8ef28260cd913b8a 100644 (file)
                     var order = 1000;
                     $.each(when, function (property, conditions) {
                         var val = $(form).find('[name="' + property + '"]').val().toString();
+                        var matchproperty = false;
                         $.each(conditions, function (k, condition) {
-                            if (condition.id !== val) {
-                                match = false;
+                            if (condition.id === val) {
+                                matchproperty = true;
+                                order = Math.min(order, condition.order);
                                 return false;
                             }
-                            order = Math.min(order, condition.order);
                         });
-                        if (match === false) {
+                        if (matchproperty === false) {
+                            match = false
                             return false;
                         }
                     });
@@ -76,6 +78,7 @@
                     });
                     res[property] = normalizedConditions;
                 });
+                console.log(res);
                 return res;
             }