From 68e4ba1a7f6614b4c2b590dcf636cdc9263423a0 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 30 Oct 2020 13:29:43 +0100 Subject: [PATCH] wait #4013 @0.5 --- src/public/bunchmultiple/bunchmultiple.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/public/bunchmultiple/bunchmultiple.js b/src/public/bunchmultiple/bunchmultiple.js index bffcb84..cf9856d 100644 --- a/src/public/bunchmultiple/bunchmultiple.js +++ b/src/public/bunchmultiple/bunchmultiple.js @@ -87,7 +87,11 @@ $.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(); @@ -140,7 +144,19 @@ 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) { @@ -206,7 +222,7 @@ } catch (e) { console.log(e); } - this.updateLegends(); + this.updateAndChange(); }, }; -- 2.39.5