diff --git a/source/language/en-GB/tpl_mokoonyx.ini b/source/language/en-GB/tpl_mokoonyx.ini
index 566a177..b462c10 100644
--- a/source/language/en-GB/tpl_mokoonyx.ini
+++ b/source/language/en-GB/tpl_mokoonyx.ini
@@ -287,6 +287,10 @@ TPL_MOKOONYX_SOCIAL_FLOATING_POS_DESC="Which side of the screen the floating soc
TPL_MOKOONYX_SOCIAL_FLOATING_POS_LEFT="Left"
TPL_MOKOONYX_SOCIAL_FLOATING_POS_RIGHT="Right"
TPL_MOKOONYX_SOCIAL_FLOATING_TOGGLE="Toggle social icons sidebar"
+TPL_MOKOONYX_SOCIAL_FLOATING_COLLAPSIBLE_LABEL="Collapsible"
+TPL_MOKOONYX_SOCIAL_FLOATING_COLLAPSIBLE_DESC="Show a toggle handle so visitors can collapse and expand the floating social bar. Their choice is remembered on their device."
+TPL_MOKOONYX_SOCIAL_FLOATING_COLLAPSED_LABEL="Collapsed by Default"
+TPL_MOKOONYX_SOCIAL_FLOATING_COLLAPSED_DESC="Start the floating social bar collapsed on a visitor's first visit. Visitors who have already set their own preference keep it."
TPL_MOKOONYX_SOCIAL_COLOR_LABEL="Icon Colour"
TPL_MOKOONYX_SOCIAL_COLOR_DESC="Choose the colour scheme for social icons."
TPL_MOKOONYX_SOCIAL_COLOR_THEME="Theme (CSS variables)"
diff --git a/source/language/en-US/tpl_mokoonyx.ini b/source/language/en-US/tpl_mokoonyx.ini
index a671025..6fad714 100644
--- a/source/language/en-US/tpl_mokoonyx.ini
+++ b/source/language/en-US/tpl_mokoonyx.ini
@@ -287,6 +287,10 @@ TPL_MOKOONYX_SOCIAL_FLOATING_POS_DESC="Which side of the screen the floating soc
TPL_MOKOONYX_SOCIAL_FLOATING_POS_LEFT="Left"
TPL_MOKOONYX_SOCIAL_FLOATING_POS_RIGHT="Right"
TPL_MOKOONYX_SOCIAL_FLOATING_TOGGLE="Toggle social icons sidebar"
+TPL_MOKOONYX_SOCIAL_FLOATING_COLLAPSIBLE_LABEL="Collapsible"
+TPL_MOKOONYX_SOCIAL_FLOATING_COLLAPSIBLE_DESC="Show a toggle handle so visitors can collapse and expand the floating social bar. Their choice is remembered on their device."
+TPL_MOKOONYX_SOCIAL_FLOATING_COLLAPSED_LABEL="Collapsed by Default"
+TPL_MOKOONYX_SOCIAL_FLOATING_COLLAPSED_DESC="Start the floating social bar collapsed on a visitor's first visit. Visitors who have already set their own preference keep it."
TPL_MOKOONYX_SOCIAL_COLOR_LABEL="Icon Color"
TPL_MOKOONYX_SOCIAL_COLOR_DESC="Choose the color scheme for social icons."
TPL_MOKOONYX_SOCIAL_COLOR_THEME="Theme (CSS variables)"
diff --git a/source/media/css/a11y-high-contrast.css b/source/media/css/a11y-high-contrast.css
index abd7f8d..a006a04 100644
--- a/source/media/css/a11y-high-contrast.css
+++ b/source/media/css/a11y-high-contrast.css
@@ -10,7 +10,7 @@
* INGROUP: MokoOnyx.Accessibility
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx
* PATH: ./media/css/a11y-high-contrast.css
- * VERSION: 02.27.03
+ * VERSION: 02.27.04
* BRIEF: High-contrast stylesheet for accessibility toolbar
*/
diff --git a/source/media/js/template.js b/source/media/js/template.js
index b650658..e066516 100644
--- a/source/media/js/template.js
+++ b/source/media/js/template.js
@@ -797,20 +797,27 @@
function initSocialFloating() {
var wrap = doc.getElementById("mokoSocialFloating");
var toggle = doc.getElementById("mokoSocialFloatingToggle");
+ // The toggle is only rendered when the "collapsible" param is enabled.
if (!wrap || !toggle) return;
- // Restore saved state
- try {
- if (localStorage.getItem(socialStorageKey) === "1") {
- wrap.classList.add("is-collapsed");
- toggle.setAttribute("aria-expanded", "false");
- }
- } catch (e) {}
+ // Resolve the initial collapsed state:
+ // - A returning visitor's explicit choice (localStorage) always wins.
+ // - Otherwise fall back to the admin's "collapsed by default" setting,
+ // which the layout also renders server-side to avoid a state flash.
+ var saved = null;
+ try { saved = localStorage.getItem(socialStorageKey); } catch (e) {}
+
+ var collapsed = (saved === "1" || saved === "0")
+ ? (saved === "1")
+ : (wrap.getAttribute("data-default-collapsed") === "1");
+
+ wrap.classList.toggle("is-collapsed", collapsed);
+ toggle.setAttribute("aria-expanded", collapsed ? "false" : "true");
toggle.addEventListener("click", function () {
- var collapsed = wrap.classList.toggle("is-collapsed");
- toggle.setAttribute("aria-expanded", collapsed ? "false" : "true");
- try { localStorage.setItem(socialStorageKey, collapsed ? "1" : "0"); } catch (e) {}
+ var isCollapsed = wrap.classList.toggle("is-collapsed");
+ toggle.setAttribute("aria-expanded", isCollapsed ? "false" : "true");
+ try { localStorage.setItem(socialStorageKey, isCollapsed ? "1" : "0"); } catch (e) {}
});
}
diff --git a/source/templateDetails.xml b/source/templateDetails.xml
index 38fbc7f..6c3fb81 100644
--- a/source/templateDetails.xml
+++ b/source/templateDetails.xml
@@ -35,7 +35,7 @@
mokoonyx
- 02.27.03
+ 02.27.04script.php2026-05-16Jonathan Miller || Moko Consulting
@@ -354,6 +354,20 @@
+
+
+
+
+
+
+
+