Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Conditional class 'select' for trigger #81

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conditional class 'select' for trigger #81

wants to merge 5 commits into from

Conversation

dahliacreative
Copy link

I've added in a conditional which removes the 'selected' class from the trigger if the option selected has a blank value.

This is so you can have a blank option and style the trigger differently if it is selected.

Example here: http://codepen.io/dahliacreative/pen/YyjyOP

When you click an option text goes dark, then if you select 'please select' text goes light again.

@paulstraw
Copy link
Owner

@dahliacreative, 23c5806 actually has invalid Coffee on line 151 (no === in CoffeeScript). This whole conditional can also be simplified down to trigger.toggleClass 'selected', clicked.data('raw-value') != ''. I'll be happy to merge this if you update those and recompile the JS output from the Coffee source! 👍

@dahliacreative
Copy link
Author

@paulstraw Done :)
I apologise if it still isn't right, I've never used coffee script before.

@paulstraw
Copy link
Owner

The CoffeeScript looks right, but I'm not totally sure what's going on with the JS. How did you recompile that?

@dahliacreative
Copy link
Author

I re-compiled it using an online tool. Can you suggest something I can use to compile and I'll give it a go.

@dahliacreative
Copy link
Author

I will sort this PR out as well when I get some free time, I might just have to fork it though and add my own functions as I just can;t get my head around coffee script.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants