Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added custom placeholder option. #46

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

Conversation

muratgorken
Copy link

added custom placeholder option. Users can show placeholder if doesn't selected any item.

added custom placeholder option. Users can show placeholder if doesn't selected any item.
updated placeholder for custom placeholder. I missed update readme.md
src/index.js Outdated Show resolved Hide resolved
@muratgorken
Copy link
Author

Can you check again? @JuanRaymundo

@JuanRaymundo
Copy link

@oquis

Users now can set placeholder option from html attribute.
Updated readme.md for set placeholder option from html attribute.
@@ -21,6 +22,9 @@ import 'styles/main.scss';
beforeDecrement: () => true,
beforeIncrement: () => true,
setSelectionText (itemCount, totalItems) {
if (totalItems == 0 && this.placeHolderText != '') {
Copy link
Member

Choose a reason for hiding this comment

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

equality and inequality should use === and !== accordingly

@@ -36,6 +40,7 @@ import 'styles/main.scss';
const dataAttrOptions = {
selectionText: $selection.data('selection-text'),
textPlural: $selection.data('text-plural'),
placeHolderText: $this.data("placeholder"),
Copy link
Member

Choose a reason for hiding this comment

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

strings must use single quotes. you can check for lint errors running yarn lint

@@ -116,6 +116,8 @@ $(document).ready(() => {
selectionText: 'item',
// text to show for multiple items
textPlural: 'items',
// text to show placeholder
placeHolderText: 'Custom Placeholder',
Copy link
Member

Choose a reason for hiding this comment

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

i think placeholder is a better name so it matches the data-prop attribute

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

Successfully merging this pull request may close these issues.

3 participants