skttl / umbraco-matryoshka

Matryoshka enables you to layer your document type properties in tabs and groups
MIT License
13 stars 10 forks source link

Adds option to make groups collapsible #22

Closed skttl closed 4 years ago

skttl commented 4 years ago

Fixes #3

I got this working with some Jquery trickery. You can see it in action in this gif: T9j2RgWhRt

The group separator property editor is extended with two new options. One for setting a group to be able to collapse, and one the set it as collapsed by default.

chrome_99FBdKHEFh

What do you guys think? Would this be useful?

NikRimington commented 4 years ago

I think this would be cool :-) Maybe the "Collapsed by Default" option should only show if "Collapsible" is toggled on? Could there be an option to "Start Collapsed if Edit" ? The reason for this idea is when you create a new page you'd probably want everything expanded, but if editing, you might have sections that are rarely edited so better of starting collapsed in that state?

skttl commented 4 years ago

Works in Nested Content too... Ake9X9d5DX

skttl commented 4 years ago

Ooh, "Start Collapsed If Edit" would be nice!

I opted for both Collapsible and Collapsed by default because it was easier to implement two boolean prevalues, than coming up with my own editor for that :) Also thought of making a radio button list, but didn't bother looking up how to :)

lars-erik commented 4 years ago

Nice!
I think you could even get away with neither jQuery nor Angular on this, btw.

skttl commented 4 years ago

@NikRimington (and others)

How about this for config? Is the wording meaningful? image

There is a minor problem about expanding collapsed groups on creation, it doesn't work for elements like Nested Content items, or DTGEs.

NikRimington commented 4 years ago

Not sure, I found reading them quite tough.

What about

Fixed, Collapsible, open on load, Collapsible, closed on load Collapsible, open on creation, closed on edit,

In the description for the setting something like

Should this group be collapsible? And what default state should they have?

Might make it easier to understand?

skttl commented 4 years ago

Much better, thanks!

skttl commented 4 years ago

@NikRimington while you are at it - how about the other setting? :)

NikRimington commented 4 years ago

Setting name: Show in tab drop-down Description: Show separator in drop-down on tab to allow editor to jump to this section.

How about that?