From b11f1033c8a0b8b0c46ebeba96889fc96041c399 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 25 Apr 2025 11:53:45 +0200 Subject: [PATCH] wip #7498 @0.5 --- .../bunchmultiple/bunchmultiplemodule.js | 29 ++----------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/src/public/bunchmultiple/bunchmultiplemodule.js b/src/public/bunchmultiple/bunchmultiplemodule.js index 31f7869..313c8b9 100644 --- a/src/public/bunchmultiple/bunchmultiplemodule.js +++ b/src/public/bunchmultiple/bunchmultiplemodule.js @@ -93,10 +93,11 @@ JQbunchmultiple.prototype = { $(this.element).addClass('bunchmultiple_root'); } + this.updateLegends(); + setTimeout(function () { $this.inited = true; $this.updateAndChange(); - }, 1000); this.resize(); @@ -229,7 +230,6 @@ JQbunchmultiple.prototype = { duplicateItem: function (item) { let copy = $(item).clone(); - console.log(copy); $(copy).insertAfter(item); this.updateAndChange(); }, @@ -242,7 +242,6 @@ JQbunchmultiple.prototype = { }, replaceData: function (data) { - console.log(data); this.empty(false); var $this = this; $.each(data, function (k, v) { @@ -260,7 +259,6 @@ JQbunchmultiple.prototype = { }, initItem: function (values) { - var $this = this; var collapsed = true; var isNew = false; @@ -270,6 +268,7 @@ JQbunchmultiple.prototype = { isNew = true; } var item = this.element.find('.sample' + this.bmidselector).clone(false); + $(item).attr('data-debug-data', JSON.stringify(values)); if (isNew) { $(item).find('[data-reset-value]').val(''); } @@ -373,25 +372,3 @@ jQuery.fn.bunchmultiple = function () { } }) }; - -jQuery(document).ready(function ($) { - $(".bunchmultiple").bunchmultiple(); - -}); - -jQuery.cachedScript = function (url, options) { - - // Allow user to set any option except for dataType, cache, and url - options = $.extend(options || {}, { - dataType: "script", cache: true, url: url - }); - - // Use $.ajax() since it is more flexible than $.getScript - // Return the jqXHR object so we can chain callbacks - return jQuery.ajax(options); -}; - -function replaceAll(from, to, str) { - var e = str.split(from); - return e.join(to); -} -- 2.39.5