[TikiWiki-commits] [Git][tikiwiki/tiki][master] [ENH] Improve toggle button styling and functionality in tiki collapse module

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68e7cb26298aa_2ce060054473@gitlab-sidekiq-low-urgency-cpu-bound-v2-7588bc7b87-fs7rd.mail>

Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
dc3d09dc by Moïse Nturubika at 2025-10-09T14:37:43+00:00
[ENH] Improve toggle button styling and functionality in tiki collapse module
---
* [FIX] Move css from mod-collapse to the right place

* [ENH] Improve collapse module with button_label parameter and streamlined UI

* Improve toggle button styling and functionality in tiki collapse module

See merge request tikiwiki/tiki!6597

- - - - -


2 changed files:

- templates/modules/mod-collapse.tpl
- themes/base_files/scss/_tiki-modules.scss


Changes:

=====================================
templates/modules/mod-collapse.tpl
=====================================
@@ -1,6 +1,9 @@
-{tikimodule error=$module_error title=$tpl_module_title name=$tpl_module_name flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle type=$module_type}
-    <button type="button" class="navbar-toggle" data-bs-toggle="collapse" data-bs-target="{$module_params.target}"{if !empty($module_params.parent)} data-bs-parent="{$module_params.parent}"{/if}>
-        <span class="sr-only">{tr}Toggle navigation{/tr}</span>
+{tikimodule error=$module_error title=$tpl_module_title name=$tpl_module_name flip=$module_params.flip decorations=$module_params.decorations nobox="y" notitle="y" type=$module_type}
+    <button type="button" class="btn btn-primary btn-toggle collapsed" data-bs-toggle="collapse" data-bs-target="{$module_params.target}" {if !empty($module_params.parent)} data-bs-parent="{$module_params.parent}"{/if} aria-expanded="false">
+        <span class="btn-text">
+            <span class="show-text">{tr}Show{/tr}{if !empty($module_params.button_label)} {$module_params.button_label}{/if}</span>
+            <span class="hide-text">{tr}Hide{/tr}{if !empty($module_params.button_label)} {$module_params.button_label}{/if}</span>
+        </span>
         <span class="icon-bar"></span>
         <span class="icon-bar"></span>
         <span class="icon-bar"></span>


=====================================
themes/base_files/scss/_tiki-modules.scss
=====================================
@@ -473,3 +473,17 @@ header.fixed-top {
     --tiki-fixed-top-border-top-width: 0px;
     --tiki-fixed-top-border-bottom-width: 5px;
 }
+
+// mod-collapse styles
+.btn-toggle:not(.collapsed) .show-text {
+    display: none;
+}
+.btn-toggle:not(.collapsed) .hide-text {
+    display: inline;
+}
+.btn-toggle.collapsed .show-text {
+    display: inline;
+}
+.btn-toggle.collapsed .hide-text {
+    display: none;
+}



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/dc3d09dcb3019be923e6267dbacbeec3004d1fee

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/dc3d09dcb3019be923e6267dbacbeec3004d1fee
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.