@total_onion/onion-modalcontroller 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/onion-modalcontroller.js +12 -8
- package/package.json +1 -1
package/onion-modalcontroller.js
CHANGED
|
@@ -70,13 +70,17 @@ export default class modalController {
|
|
|
70
70
|
if (!popupContent) {
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
popupContent.innerHTML = "";
|
|
73
|
+
// popupContent.innerHTML = "";
|
|
74
74
|
const modalPopupContent = document
|
|
75
|
-
.querySelector(`[data-modalpopupcontent=${triggerName}]`)
|
|
76
|
-
?.cloneNode(true);
|
|
75
|
+
.querySelector(`[data-modalpopupcontent=${triggerName}]`);
|
|
76
|
+
// ?.cloneNode(true);
|
|
77
77
|
|
|
78
78
|
if (modalPopupContent) {
|
|
79
|
+
popupContent.querySelectorAll("[data-modalpopupcontent]").forEach((el) => {
|
|
80
|
+
el.classList.remove("active");
|
|
81
|
+
});
|
|
79
82
|
popupContent.appendChild(modalPopupContent);
|
|
83
|
+
modalPopupContent.classList.add("active");
|
|
80
84
|
const sections = popupContent.querySelectorAll(["data-assetkey"]);
|
|
81
85
|
sections.forEach((section) => {
|
|
82
86
|
section.classList.remove("loaded");
|
|
@@ -122,11 +126,11 @@ export default class modalController {
|
|
|
122
126
|
const popupContent = modalPopup.querySelector(
|
|
123
127
|
".modal-controller-popup__content"
|
|
124
128
|
);
|
|
125
|
-
if (popupContent) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
129
|
+
// if (popupContent) {
|
|
130
|
+
// setTimeout(() => {
|
|
131
|
+
// popupContent.innerHTML = "";
|
|
132
|
+
// }, 300);
|
|
133
|
+
// }
|
|
130
134
|
}
|
|
131
135
|
closePopupOnClickOutside(event, modalPopup) {
|
|
132
136
|
if (event.target === modalPopup) {
|