Skip to content

Moved logic to add/remove collapsed (left bar) css class in appropriate event handlers #16741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

rtripault
Copy link
Contributor

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)

@smg6511
Copy link
Collaborator

smg6511 commented May 24, 2025

Hey @rtripault - First, good catch! You were definitely on the right track. As I was reviewing your PR, I found a couple issues but couldn't make my suggestions directly on your PR since they were out of the selectable range; so I went ahead and posted an alternate PR (#16748).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants