From: Vincent Vanwaelscappel Date: Fri, 30 Oct 2020 12:29:43 +0000 (+0100) Subject: wait #4013 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=68e4ba1a7f6614b4c2b590dcf636cdc9263423a0;p=cubist_cms-back.git wait #4013 @0.5 --- 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(); }, };