Hi, I generally have success themeing slideshow controls with CSS. However, I recently realized there is no class to indicate state of the pause/resume control. So the attached patch adds a "paused" class when the slideshow is paused via the controls.

The purpose of this class is to enable themers to create pause/play buttons with css. See a simple example here: http://dev.oppl.org/

Forgive me if this seems like a duplicate of some other issues (e.g. http://drupal.org/node/1270172), but for me, CSS is often a simpler approach over preconfigured "skins" in the view's config. At any rate, this is my first patch and I am not really a programmer :) If there is a better way to go about this, I would value the advice.

Thanks!

Sean

CommentFileSizeAuthor
views_slideshow-paused-class.patch911 bytesseanfitzpatrick

Comments

knalstaaf’s picture

Confirming that this patch works like a charm.

Roll it out in the js-folder of the Views Slideshow module, and add the class "paused" to the pause-selector in your theme's stylesheet.

Example:

#views_slideshow_controls_text_pause_slideheader-block a{ styles } /* pause icon */
#views_slideshow_controls_text_pause_slideheader-block.paused a{ styles } /* resume icon */

Thanks, Sean!

It's a good solution, but I think it would be easier for themers if the module would just switch the current class (I'm directing this to the maintainers now), e.g.:

#views_slideshow_controls_text_pause_slideheader-block a{ styles } /* pause icon */
#views_slideshow_controls_text_resume_slideheader-block a{ styles } /* resume icon */

The text in the controls is already switching from Pause to Resume by default currently, so couldn't it be done with the same word in the selector?

pomliane’s picture

Status: Active » Needs review

This patch also works with views_slideshow-6.x-3.0!
Thanks Sean!

EDIT : it seems this issue is a duplicate of #1322780: Provide CSS classes to indicate the status of the pause button

pomliane’s picture

Status: Needs review » Closed (duplicate)
Anonymous’s picture

Thanks Sean, this did the trick.

Cheers