Moved logic to add/remove collapsed (left bar) css class in appropriate event handlers #16741
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.
What does it do?
Moved the logic to add/remove the
collapsed
CSS class on the "trigger" to collapse/expand the manager left bar (trees)Why is it needed?
The logic was initially set in a "click" handler, making it only happening when clicking on the trigger (arrow).
However, ExtJS code (
Ext.getCmp('modx-layout').toggleLeftbar()
,Ext.getCmp('modx-layout').hideLeftbar()
,Ext.getCmp('modx-layout').showLeftbar()
) could also be executed to perform the same action without "clicking" on the trigger, resulting in visual contraction like having the tree collapsed, but the trigger offering to collapsed it anyway.How to test
Once the manager is loaded, in the browser console, execute
Ext.getCmp('modx-layout').toggleLeftbar()
Without this patch, the "trigger" arrow should not change direction. With this patch applied, it should reflect the tree state (collapsed or expanded)