[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][ENH] Improve toggle button styling and functionality in tiki collapse module

"ushindi bienvenu \(@usbbush\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <691f068736a4d_2a1bfe8883880@gitlab-sidekiq-low-urgency-cpu-bound-v2-6f7cb86f8c-9cpt5.mail>

ushindi bienvenu pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
e0106d34 by Moïse Nturubika at 2025-11-20T12:08:04+00:00
[BP][ENH] Improve toggle button styling and functionality in tiki collapse module
---
* [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

See merge request tikiwiki/tiki!8947

- - - - -


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
=====================================
@@ -479,3 +479,17 @@ header.fixed-top {
 .tiki-module-header-top {
     margin-top: 35px;
 }
+
+// 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/e0106d347ac69161fcae30ef9b9dc665c4536a29

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/e0106d347ac69161fcae30ef9b9dc665c4536a29
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.