Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.

Feature: Introduce new form type LimitedTextarea #3

Open
wants to merge 10 commits into
base: 1.x
Choose a base branch
from

Conversation

ceesvanegmond
Copy link
Contributor

Opening this PR because of a new where we could limit inputs.

See #1 for reference

Copy link

@RutgerKooijman RutgerKooijman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the error styling shouldn't be in the countable css @vanhoog can you please change this to a more logical place?

@vanhoog
Copy link

vanhoog commented Sep 25, 2017

@RutgerKooijman I think it should as in this situation it is part of the bundle.

Meaning it should work correctly when used independent in a different theme. Hence why I chose to include the error colour inside this bundle.

@@ -0,0 +1,10 @@
.error { color: #900;}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vanhoog Maybe it's better to use class names specific for this js-counter thing? .error is kind of global. Same for counter-text? Maybe specify it more on this new element?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could refactor it with the new Just CSS naming standard, which i'll do... I'll keep you posted! :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's important to specify this correctly, maybe wrap it all in wearejust-counter class? We don't need conflicting classnames

}
})
});
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code duplication: your doing the same things twice. Abstract the 'keyup' function so you can call it as an event listener but also call it right after init.
And instead of using an if(<CONDITION) with addClass/removeClass, you can use toggleClass('classname', ).

Also notice that it only applies to textarears, shouldnt it also work for inputs?

@bartkoelewijn
Copy link

@ceesvanegmond Can't find the feature branch. What happened with his?

@ceesvanegmond
Copy link
Contributor Author

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.

5 participants