Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a global "expand/collapse elements" button #6303

Merged
merged 19 commits into from Nov 22, 2023

Conversation

aschempp
Copy link
Member

@aschempp aschempp commented Aug 16, 2023

Implements #6025

What I have not figured out yet (and could not find any useful resources on the internet) was how to efficiently localize the controller. Passing 6 labels on ever instantiation feels wrong to me, but having a global array feels wrong too 馃し any ideas?

@aschempp aschempp added this to the 5.3 milestone Aug 16, 2023
@aschempp aschempp requested a review from a team August 16, 2023 08:31
@aschempp aschempp self-assigned this Aug 16, 2023
@fritzmg
Copy link
Contributor

fritzmg commented Aug 16, 2023

I'd just output the labels as JSON in an additional data attribute.

@aschempp
Copy link
Member Author

I'd just output the labels as JSON in an additional data attribute.

but this would output the labels for every data-controller again and again?

@fritzmg
Copy link
Contributor

fritzmg commented Aug 27, 2023

Which is good enough, since there will likely only be one toggle button per back end response, or won't there?

@aschempp
Copy link
Member Author

no, the controller is on every content element that implements the dynamic height property. It dynamically generates the global toggle operation on the fly.

@aschempp
Copy link
Member Author

I have rewritten the whole controller script and approach. Instead of setting a limit_height (and corresponding height class) in your custom row callback, you can now set a list.sorting.limitHeight property on the DCA, and it will automatically generate the necessary operation and wrapper DIVs in DC_Table 馃槑

@leofeyer leofeyer changed the title Implemented global expand/collapse elements button Implement a global expand/collapse elements button Nov 22, 2023
@leofeyer leofeyer changed the title Implement a global expand/collapse elements button Implement a global "expand/collapse elements" button Nov 22, 2023
@leofeyer leofeyer merged commit ff0decb into contao:5.x Nov 22, 2023
16 checks passed
@leofeyer
Copy link
Member

Thank you @aschempp.

@aschempp aschempp deleted the feature/toggle-elements branch November 23, 2023 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Usability: Add new button for toggling all content elements at once
3 participants