The "Show more" links on facets should include a CSS class that gets toggled when they are clicked. This allows them to be styled differently depending on their state (with arrows, for example).

CommentFileSizeAuthor
#1 1346726-1-active-css-class.patch797 bytesmilesw

Comments

milesw’s picture

StatusFileSize
new797 bytes

Very simple patch.

milesw’s picture

Status: Active » Needs review

Changing status...

cpliakas’s picture

Category: task » feature
Priority: Minor » Normal
Status: Needs review » Needs work

Hi milesw.

I like the idea of this patch, and the functionality works great. Marking as "needs work" for the nit-picky reason that CSS classes in Facet API are prefixed with "facetapi-" and have a descriptive name such as "-limit-link-expanded". Or is the "open" class something standard in Drupal that I don't know about? Also, I think that it might be useful to have a "facetapi-limit-link-collapsed" class as well when the link is in the "Show more" state. Let me know your thoughts on this.

Thanks for the contribution!
~Chris

milesw’s picture

Hi Chris,

Since the links already have a facetapi class to identify them (facetapi-limit-link), I personally don't think there's a need for another facetapi prefixed class. This is the way a menu works – active menu items get the "active" class added, but the main classes don't change.

I couldn't find any Drupal conventions for this type of class name. Using "active" seems a little funny in this case. I chose "open" instead of "expanded" because it might be just a little more widely understood (by other languages). Certainly not married to it though.

I just realized it might be a good idea to add the same class to the list element as well. Think so?

cpliakas’s picture

Status: Needs work » Reviewed & tested by the community

Re: your points in #4, makes sense to me.

In terms of adding the same class to the list items, I would be open to this although I don't see the use case (probably because I am not design oriented). I think it would be good to open a separate issue to discuss that one.

Thanks,
Chris

cpliakas’s picture

Status: Reviewed & tested by the community » Fixed

Committed at b0b3c34.

Congrats on becoming the 14th committer to Facet API!

milesw’s picture

Great, thanks Chris! Hope to get more involved, especially with the design oriented areas.

cpliakas’s picture

Great! Really looking for design contributions, as I think that is where the most potential for this project is.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.