Allows starting individual branches expanded or collapsed#116
Open
dustinbolton wants to merge 1 commit intomjsarfatti:2.0alphafrom
Open
Allows starting individual branches expanded or collapsed#116dustinbolton wants to merge 1 commit intomjsarfatti:2.0alphafrom
dustinbolton wants to merge 1 commit intomjsarfatti:2.0alphafrom
Conversation
This update allows you to preset the expanded or collapsed class on individual branches to give finer grain control over individual branch status on start. This allows overriding the default startCollapsed option on a per-branch level as needed. I needed this so that I could ‘remember’ the state of individual branches and restore them on page load.
|
Could you include a usage example ? In the absence of tests, that's the closest thing.. |
Author
|
Here's a usage example. If you wish to override the default behavior (which is either all open or all closed based on the startCollapsed setting), just apply the appropriate class to the li to force it to start whichever way you like. <ol class="sortable">
<li class="mjs-nestedSortable-expanded"><div>Starts open, overriding default</div></li>
<li class="mjs-nestedSortable-collapsed"><div>Starts collapsed, overriding default</div></li>
<li><div>Starts open or closed based on startCollapsed setting; default behavior </div></li>
</ol> |
Author
There was a problem hiding this comment.
Usage example:
<ol class="sortable">
<li class="mjs-nestedSortable-expanded"><div>Starts open, overriding default</div></li>
<li class="mjs-nestedSortable-collapsed"><div>Starts collapsed, overriding default</div></li>
<li><div>Starts open or closed based on startCollapsed setting; default behavior </div></li>
</ol>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This update allows you to explicitly define the starting state of individual branches to be either expanded or collapsed beyond the default starting state of all collapsed or all expended. This allows overriding the default startCollapsed option on a per-branch level as needed.
On any branches you wish to start as explicitly collapsed or expanded, simply apply your defined (or default if you did not define) expandedClass or collapsedClass classname to the applicable
I needed this so that I could ‘remember’ the state of individual branches and restore them on page load.