Commit b530f2f4 authored by Sven Berg Ryen's avatar Sven Berg Ryen Committed by Sven Berg Ryen
Browse files

Issue #3313159 by svenryen: When modals open, the first one gets swatches in fields, second doesn't

parent 18696327
Loading
Loading
Loading
Loading
+5 −3
Changes for js/coloris.js: 5 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -20,11 +20,13 @@
   */
  Drupal.behaviors.coloris = {
    attach: function (context) {
      if (context !== document) {
        return;
      }
      window.setTimeout(function () {
        document.querySelectorAll('.coloris').forEach(el => {
          if (!el.getAttribute('data-coloris-once')) {
            document.body.setAttribute('data-coloris-once', 'true');
          } else {
            return;
          }
          if (!el.classList.contains('coloris--processed')) {
            let id = el.getAttribute('id');
            let parentString = el.getAttribute("data-parent");