Save box state, for default collapsed and expanded boxes.
See original GitHub issueHi,
I’m using this solution from @BlueTeck for saving box state with localstorage https://github.com/almasaeed2010/AdminLTE/issues/1064
It’s working great as long as all the boxes on a page have the same default state, all collapsed or all expanded. I’m wondering if anyone have modified it to use it when the box is collapsed by default with collapsed-box class and expanded box.
<div class="box box-primary collapsed-box" id="filters" data-name="filters">If boxes are all collapsed on the page I can use if(box.state == 1) instead of if(box.state == 0)
I also tried this with no luck
if(box.state == 0){
$('.box[data-name="'+box.boxname+'"]').find($.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors.collapse).trigger( "click" );
}
else {
$('.box[data-name="'+box.boxname+'"]').removeClass("collapsed-box");
}
Any solution is welcome Thanks
Issue Analytics
- State:
- Created 7 years ago
- Comments:11
Top Results From Across the Web
Open / Save as dialog boxes - choose whether to expand or ...
UPDATE: manually collapsed all then SHIFT-clicked the upper-right X to close the window. Reopened File Explorer, and all were collapsed.
Read more >AdminLTE collapsed boxes by default - html - Stack Overflow
Ideally, what we'd want is to have the boxes be in the "slide up" state by default with the class "collapsed-box" so that...
Read more >Starting Outlook with all folders collapsed/expanded
If a folder is collapsed and a new message is delivered to one of its subfolders, the folder will automatically expand to that...
Read more >st.expander - Streamlit Docs
Insert a multi-element container that can be expanded/collapsed. ... If True, initializes the expander in "expanded" state. Defaults to False (collapsed).
Read more >Collapse · Bootstrap v5.0
The collapse JavaScript plugin is used to show and hide content. ... element to be open by default using the show class, set...
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
Your button miss the
btn-box-tool
class, but you can change the script to catch only.btn
instead of.btn-box-tool
.That’s my button code like the preview from almasaeed2010.
Strange, i have not this issues with the icons. I had this before and then i switched the
$('.box[data-name="'+box.boxname+'"]').find('.btn-box-tool[data-widget="collapse"...
from the if’s (before i posted it here)here my full code