Skip to:
Content

BuddyPress.org

Opened 6 years ago

Closed 5 years ago

Last modified 3 years ago

#5498 closed enhancement (fixed)

Add 'state' classes to visibility settings JS

Reported by: hnla Owned by: boonebgorges
Milestone: 2.1 Priority: low
Severity: minor Version:
Component: Templates Keywords: has-patch early
Cc: hnla

Description

Patch adds 'state' classes; 'open' to the .field-visibility-settings element & 'hide' to .field-visibility-settings-toggle adding /removing them according to the click events.

This enhancement allows CSS to 'know' what state the elements are in and to then be able to render styles accordingly e.g transitions, but in general increases the devs options in managing the elements.

Ideally all control of visual states should be handed back to CSS with JS simply being used to set classes & CSS handling display or any other effects, however wasn't sure what the implications would be on established sites that may have overloaded styles and would suddenly lose the js functionality.

Probably to late to squeeze into 2.0 but useful if we could push this into 2.1?

Attachments (1)

5498.patch (1.2 KB) - added by hnla 6 years ago.
Add classes to visibility settings elements via JS

Download all attachments as: .zip

Change History (6)

@hnla
6 years ago

Add classes to visibility settings elements via JS

#1 @DJPaul
6 years ago

  • Keywords early added
  • Milestone changed from Awaiting Review to 2.1

#2 @boonebgorges
5 years ago

Only issue is that the classes 'hide' and 'open' are pretty general, and are likely to cause conflict with styles provided by some themes/plugins. (I had this problem once with the class 'open', and it was very ugly to fix it.) I'm going to make them a bit more specific to the BP context.

#3 @boonebgorges
5 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 8409:

Add state CSS classes to xprofile field visibility toggles and settings divs

This gives themers greater control over the behavior of these elements, by
telling them which "state" they're in.

Fixes #5498

Props hnla

#4 @hnla
5 years ago

Only issue is that the classes 'hide' and 'open' are pretty general

very good point, I should have pseudo namespaced them or given prefix context

I had this problem once with the class 'open', and it was very ugly to fix it

:) Literally had the same sort of issue two days ago with a scriptlet I wrote which I had to port to another theme.

#5 @DJPaul
3 years ago

  • Component changed from Appearance - Template Parts to Templates
Note: See TracTickets for help on using tickets.