From: Vincent Vanwaelscappel Date: Fri, 14 Jun 2019 10:33:57 +0000 (+0200) Subject: #2834 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=bb0191c6bdb73a429ee1d7af5a1a0563cf6b2ccd;p=cubist_cms-back.git #2834 --- 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; }