]> _ Git - cubist_cms-back.git/commitdiff
wip #7498 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 25 Apr 2025 09:53:45 +0000 (11:53 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 25 Apr 2025 09:53:45 +0000 (11:53 +0200)
src/public/bunchmultiple/bunchmultiplemodule.js

index 31f7869b93c9d16cd16fb8ec5d666185a7e15b42..313c8b92d750b5c230adbad68ad40320769e6f62 100644 (file)
@@ -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);
-}