Collapse Box
See original GitHub issueHi,
I changed the app.js to allow the user to collapse a box when he clicks on .box-header :
Add the function (around line 580) :
collapseHeader: function (element) {
var _this = this;
//Find the box parent
var box = element.parents(".box").first();
//Find the body and the footer
var box_content = box.find("> .box-body, > .box-footer");
if (!box.hasClass("collapsed-box")) {
//Convert minus into plus
box.children(".box-header").children(".box-tools").children(_this.selectors.collapse).children(":first")
.removeClass(_this.icons.collapse)
.addClass(_this.icons.open);
//Hide the content
box_content.slideUp(300, function () {
box.addClass("collapsed-box");
});
} else {
//Convert plus into minus
box.children(".box-header").children(".box-tools").children(_this.selectors.collapse).children(":first")
.removeClass(_this.icons.open)
.addClass(_this.icons.collapse);
//Show the content
box_content.slideDown(300, function () {
box.removeClass("collapsed-box");
});
}
},
And the config (around line 90) :
collapseHeader: '[data-widget="collapse-header"]'
And finaly use data-widget="collapse-header"
on the box-header
:
<div class="box">
<div class="box-header" data-widget="collapse-header">
<h3 class="box-title">Your Title</h3>
<div class="box-tools pull-right">
<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
</div>
</div><!-- /.box-header -->
<div class="box-body">
</div><!-- /.box-body -->
</div><!-- /.box -->
Can you add this functionality in the template (I think it needs to be rewrite 😄) ?
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Collapse - Bootstrap
Toggle the visibility of content across your project with a few classes and our JavaScript plugins.
Read more >Collapsible Box - Amazon.com
Amazon Basics Collapsible Fabric Storage Cubes Organizer with Handles, 10.5"x10. · SHIMOYAMA Small Storage Crate, 12L Collapsible Open Storage Bin, 2 Pack, ...
Read more >Bootstrap Collapse - W3Schools
The .collapse class indicates a collapsible element (a <div> in our example); this is the content that will be shown or hidden with...
Read more >Collapsing Box - Etsy
Check out our collapsing box selection for the very best in unique or custom, handmade pieces from our shops.
Read more >collapse box - Glossary - Usability First
A collapse box is a box used in a window's title bar in MacOS that causes the window to shrink or expand, leaving...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You need to modify the app.js further with the following around line 568… below
Can anyone provide a working JS copy with this feature, as around line x mentioned is not enough clear …