From bb0191c6bdb73a429ee1d7af5a1a0563cf6b2ccd Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 14 Jun 2019 12:33:57 +0200 Subject: [PATCH] #2834 --- src/resources/views/when.blade.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/resources/views/when.blade.php b/src/resources/views/when.blade.php index dcc34fa..c34f7da 100644 --- a/src/resources/views/when.blade.php +++ b/src/resources/views/when.blade.php @@ -18,14 +18,16 @@ 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; } -- 2.39.5