Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

add a class if character limit exceed's #1

Merged
merged 1 commit into from Mar 4, 2013

Conversation

Projects
None yet
2 participants
Contributor

karyboy commented Mar 4, 2013

add a class if the character count exceeds the limit.
For example,
If we want to change the color of couter_label to red when limit exceeds,

we can have a class

.limit{
   color:red
}

we call the counter function with options

$('textarea[data-max-length]').counter({'limitExceedClass':'limit'});
Owner

krisleech commented Mar 4, 2013

Thanks! Is this backwards compatible, so not including limitExceedClass would still work as before? Looking at your code I see your default to an empty string, is addClass('') a no-op?

Contributor

karyboy commented Mar 4, 2013

Yes , this is backwards compatible . Even if we do not include limitExceedClass , this works as before . addClass("") does not add any class with an empty string..

krisleech added a commit that referenced this pull request Mar 4, 2013

Merge pull request #1 from karyboy/master
add a class if character limit exceed's

@krisleech krisleech merged commit c545523 into krisleech:master Mar 4, 2013

Contributor

karyboy commented Mar 4, 2013

Thanks ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment