@openeuropa/bcl-theme-joinup 1.10.8 → 1.10.9
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/css/oe-bcl-joinup.css +156 -85
- package/css/oe-bcl-joinup.css.map +1 -1
- package/css/oe-bcl-joinup.min.css +1 -1
- package/css/oe-bcl-joinup.min.css.map +1 -1
- package/js/oe-bcl-joinup.bundle.js +68 -1
- package/js/oe-bcl-joinup.bundle.js.map +1 -1
- package/js/oe-bcl-joinup.bundle.min.js +1 -1
- package/js/oe-bcl-joinup.bundle.min.js.map +1 -1
- package/js/oe-bcl-joinup.esm.js +67 -1
- package/js/oe-bcl-joinup.esm.js.map +1 -1
- package/js/oe-bcl-joinup.esm.min.js +1 -1
- package/js/oe-bcl-joinup.esm.min.js.map +1 -1
- package/js/oe-bcl-joinup.umd.js +68 -1
- package/js/oe-bcl-joinup.umd.js.map +1 -1
- package/js/oe-bcl-joinup.umd.min.js +1 -1
- package/js/oe-bcl-joinup.umd.min.js.map +1 -1
- package/package.json +7 -7
- package/src/js/index.esm.js +2 -0
- package/src/js/index.umd.js +2 -0
- package/templates/bcl-file/file.html.twig +1 -1
- package/templates/bcl-header/header.html.twig +43 -50
- package/templates/bcl-links-block/links-block.html.twig +1 -1
- package/templates/bcl-mega-menu/mega-menu-submenu.html.twig +10 -7
- package/templates/bcl-modal/modal.html.twig +4 -3
- /package/templates/{bcl-toast → bcl-toasts}/toasts.html.twig +0 -0
|
@@ -6923,6 +6923,72 @@
|
|
|
6923
6923
|
|
|
6924
6924
|
defineJQueryPlugin$1(Toast);
|
|
6925
6925
|
|
|
6926
|
+
const HEADER_SELECTOR = ".bcl-header";
|
|
6927
|
+
const TOGGLER_SELECTOR = ".bcl-navbar-toggler";
|
|
6928
|
+
const OFFSET_VARIABLE = "--oel-mega-menu-offset-top";
|
|
6929
|
+
class Header {
|
|
6930
|
+
scheduleUpdate = () => {
|
|
6931
|
+
if (this.frameRequest) {
|
|
6932
|
+
return;
|
|
6933
|
+
}
|
|
6934
|
+
this.frameRequest = window.requestAnimationFrame(() => {
|
|
6935
|
+
this.frameRequest = null;
|
|
6936
|
+
this.updateOffset();
|
|
6937
|
+
});
|
|
6938
|
+
};
|
|
6939
|
+
constructor(element) {
|
|
6940
|
+
this.element = element;
|
|
6941
|
+
this.frameRequest = null;
|
|
6942
|
+
this.resizeObserver = null;
|
|
6943
|
+
this.init();
|
|
6944
|
+
}
|
|
6945
|
+
init() {
|
|
6946
|
+
this.updateOffset();
|
|
6947
|
+
EventHandler.on(window, "resize", this.scheduleUpdate);
|
|
6948
|
+
EventHandler.on(window, "orientationchange", this.scheduleUpdate);
|
|
6949
|
+
const togglers = SelectorEngine.find(TOGGLER_SELECTOR, this.element);
|
|
6950
|
+
togglers.forEach(toggler => {
|
|
6951
|
+
// Some layouts move the header when the nav toggler expands; keep offset in sync.
|
|
6952
|
+
EventHandler.on(toggler, "click", this.scheduleUpdate);
|
|
6953
|
+
});
|
|
6954
|
+
}
|
|
6955
|
+
updateOffset() {
|
|
6956
|
+
if (!this.element) {
|
|
6957
|
+
return;
|
|
6958
|
+
}
|
|
6959
|
+
const rect = this.element.getBoundingClientRect();
|
|
6960
|
+
const offset = Math.max(0, rect.top);
|
|
6961
|
+
const value = `${offset}px`;
|
|
6962
|
+
if (this.element.style.getPropertyValue(OFFSET_VARIABLE) === value) {
|
|
6963
|
+
return;
|
|
6964
|
+
}
|
|
6965
|
+
this.element.style.setProperty(OFFSET_VARIABLE, value);
|
|
6966
|
+
}
|
|
6967
|
+
static init(root) {
|
|
6968
|
+
if (typeof document === "undefined" || typeof window === "undefined") {
|
|
6969
|
+
return;
|
|
6970
|
+
}
|
|
6971
|
+
const resolvedRoot = root || document;
|
|
6972
|
+
const context = resolvedRoot instanceof Element ? resolvedRoot : resolvedRoot.documentElement || document.documentElement;
|
|
6973
|
+
const headers = SelectorEngine.find(HEADER_SELECTOR, context);
|
|
6974
|
+
headers.forEach(headerElement => {
|
|
6975
|
+
if (headerElement.dataset.headerOffsetInitialized === "true") {
|
|
6976
|
+
return;
|
|
6977
|
+
}
|
|
6978
|
+
headerElement.dataset.headerOffsetInitialized = "true";
|
|
6979
|
+
new Header(headerElement);
|
|
6980
|
+
});
|
|
6981
|
+
}
|
|
6982
|
+
}
|
|
6983
|
+
if (typeof document !== "undefined") {
|
|
6984
|
+
const initializeHeaderOffset = () => Header.init();
|
|
6985
|
+
if (document.readyState === "loading") {
|
|
6986
|
+
document.addEventListener("DOMContentLoaded", initializeHeaderOffset);
|
|
6987
|
+
} else {
|
|
6988
|
+
initializeHeaderOffset();
|
|
6989
|
+
}
|
|
6990
|
+
}
|
|
6991
|
+
|
|
6926
6992
|
/**
|
|
6927
6993
|
* --------------------------------------------------------------------------
|
|
6928
6994
|
* Bootstrap (v5.1.0): index.esm.js
|
|
@@ -6948,7 +7014,8 @@
|
|
|
6948
7014
|
ScrollSpy,
|
|
6949
7015
|
Tab,
|
|
6950
7016
|
Toast,
|
|
6951
|
-
Tooltip
|
|
7017
|
+
Tooltip,
|
|
7018
|
+
Header
|
|
6952
7019
|
};
|
|
6953
7020
|
|
|
6954
7021
|
return index_umd;
|