]> _ Git - cubist_cms-back.git/commitdiff
wait #4013 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 30 Oct 2020 12:29:43 +0000 (13:29 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 30 Oct 2020 12:29:43 +0000 (13:29 +0100)
src/public/bunchmultiple/bunchmultiple.js

index bffcb84c52f73584531827f1770cdbe62ef64e5e..cf9856d3c9b4c720bccbcedc1db64c6ff2434c0b 100644 (file)
             $.each(this.element.find('.item' + this.bmidselector + ':not(.sample) .subform' + this.bmidselector), function () {
 
                 $(this).find('.bunchmultiple').each(function () {
-                    $(this).data('bunchmultiple').serialize();
+                    try {
+                        $(this).data('bunchmultiple').serialize();
+                    } catch (e) {
+
+                    }
                 });
 
                 var data = $(this).find(':input' + $this.bmidselector).serializeArray();
             if (this.element.find('.item' + this.bmidselector + ':not(.sample)').length === 0) {
                 this.initItem();
             }
+
+            console.log('removed', item);
+
+            var $this = this;
+            setTimeout(function () {
+                $this.updateAndChange();
+            }, 250);
+            $this.updateAndChange();
+        },
+
+        updateAndChange: function () {
             this.update();
+            $(this).trigger('change');
         },
 
         initItem: function (values) {
             } catch (e) {
                 console.log(e);
             }
-            this.updateLegends();
+            this.updateAndChange();
         },
     };