]> _ Git - cubist_cms-back.git/commitdiff
fix #2813 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 18 Jul 2019 09:33:14 +0000 (11:33 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 18 Jul 2019 09:33:14 +0000 (11:33 +0200)
src/public/bunchmultiple/bunchmultiple.js
src/resources/views/fields/tags.blade.php

index ecd03fef07f94e77634110880840ac731c5aacf0..b795cd6e364181a6275467309b9a9a0568ab7f30 100644 (file)
         setValues(item, values) {
             var id = this.element.attr('id');
             $.each(values, function (k, v) {
-                $(item).find('[name="' + id + '___' + k + '"]').val(v);
+                var inputs = $(item).find('[name="' + id + '___' + k + '"]');
+                if (inputs.filter('[type="checkbox"]').length > 0) {
+                    inputs.filter('[type="checkbox"]').prop('checked', v === '1');
+                } else {
+                    inputs.val(v);
+                }
             });
             this.updateLegends();
         },
index 40902b21bb84d4686d9bf9b817f82c0575d37f22..9c4b1ef1050066d5798407bc8f06d989b7a24ffa 100644 (file)
@@ -10,10 +10,11 @@ if (!is_array($values)) {
 if (!$values) {
     $values = [];
 }
-$normalizedValues = [];
 if (!is_array($values)) {
     $values = [$values];
 }
+$normalizedValues = [];
+
 foreach ($values as $value) {
     if (is_object($value)) {
         $value = $value->value;