]> _ Git - cubist_cms-back.git/commitdiff
wip #3924 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 12 Oct 2020 17:54:04 +0000 (19:54 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 12 Oct 2020 17:54:04 +0000 (19:54 +0200)
src/resources/views/when.blade.php

index 9941b78994432ef93a18b4ec78e12a2455d4b57a..04d4fcfaf867b09494ca0bd70dd07aa20423ccfa 100644 (file)
                         $(this).data('when-normalized', normalizeWhen($(this).data('when')));
                     }
                     var when = $(this).data('when-normalized');
+
                     var match = true;
                     var order = 1000;
                     $.each(when, function (property, conditions) {
                         var fname = prefix + property;
-                        var val = $(form).find('[name="' + fname + '"]').val().toString();
+                        var e = $(form).find('[name="' + fname + '"]');
+                        var val;
+                        if ($(e).length === 1) {
+                            val = $(e).val().toString();
+                        } else {
+                            var f = $(e).filter(':checked,:not(:checkbox)').last();
+                            if ($(f).length === 0) {
+                                val = '';
+                            } else {
+                                val = $(f).val().toString();
+                            }
+                        }
                         var matchproperty = false;
                         $.each(conditions, function (k, condition) {
                             if (condition.id === val) {