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

Adding container support issue #3222 #3324

Merged
merged 3 commits into from
Jun 11, 2015

Conversation

stretch4x4
Copy link
Contributor

Fixes issue #3222
Now templateSelection can have access to the parent container so that
classes can be added for styling

Fixes issue select2#3222
Now templateSelection can have access to the parent container so that
classes can be added for styling
text: 'test'
}, $container);

for (var i = 0; i < $container[0].classList.length; i += 1) {
Copy link
Member

Choose a reason for hiding this comment

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

You should be able to just use $container[0].classList.contains('testclass') here. Though that isn't supported in IE8, I'd just use $container.hasClass('testclass') honestly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did think that was a bit average but was struggling to think of a better way last night.
Thanks for the feedback, also helped me pick up that I had forgotten to rename the variable so it wasn't actually being tested anyway :(

Improving my test from feedback.
@kevin-brown
Copy link
Member

The only thing holding me back on merging this is that the single and multiple selection templates now have different parameters. If we can integrate this in with SingleSelection, that would be perfect.

@stretch4x4
Copy link
Contributor Author

I didn't really think it was applicable to single select due to it not really using the tag template and it seemed to fall back ok if you didn't use the container but it shouldn't be hard to add to the single selection and no doubt somebody will find a use.
Will see if I can find 5 minutes to solve that.

@stretch4x4
Copy link
Contributor Author

Finally got around to adding the single select support, hopefully that is ready to merge now

kevin-brown added a commit that referenced this pull request Jun 11, 2015
@kevin-brown kevin-brown merged commit 04a4e41 into select2:master Jun 11, 2015
@kevin-brown
Copy link
Member

Looks good, thanks for adding support for the single select as well.

@stretch4x4
Copy link
Contributor Author

No worries

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.

2 participants