@qhealth-design-system/core 1.1.0 → 1.2.0
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -14,12 +14,15 @@
|
|
|
14
14
|
function initGlobalAlert() {
|
|
15
15
|
|
|
16
16
|
var alerts = document.getElementsByClassName("qld__global-alert") || [];
|
|
17
|
-
var siteName =
|
|
17
|
+
var siteName = null;
|
|
18
|
+
if( document.querySelector(".qld__global-alert__include") && document.querySelector(".qld__global-alert__include").alertContainer) {
|
|
19
|
+
siteName = document.querySelector(".qld__global-alert__include").alertContainer.getAttribute("data-name");
|
|
20
|
+
}
|
|
18
21
|
var index = 0;
|
|
19
22
|
|
|
20
23
|
for (const alert of alerts) {
|
|
21
24
|
|
|
22
|
-
if (siteName
|
|
25
|
+
if (siteName) {
|
|
23
26
|
var alertSeen = QLD.utils.getCookie(`${siteName}_alertSeen_${++index}`); //increment index so the next alert can be checked.
|
|
24
27
|
if (alertSeen) { //if this specific alert is seen and closed, hide it.
|
|
25
28
|
alert.style.maxHeight = "0";
|