Determine select2 version from ACF instead of guessing from ACF version#105
Merged
Determine select2 version from ACF instead of guessing from ACF version#105
Conversation
andizer
reviewed
Oct 23, 2017
| if( field.$el.find('.acf-taxonomy-field[data-type="multi_select"]').length > 0 ){ | ||
|
|
||
| var select2Target = (helper.acf_version >= 5.6)?'select':'input'; | ||
| var select2Target = (acf.select2.version >= 4)?'select':'input'; |
Contributor
There was a problem hiding this comment.
Maybe, it is nicer to have a global minimalRequiredSelect2Version variable that contains the number 4, that is easier to read than only using a magical 4 value.
Contributor
Author
There was a problem hiding this comment.
Hm...The things is that
- This isn't a minimal required version, but rather a switch to work with any select2 version.
- The number is compared to
acf.select2.version, so isn't it pretty obvious that this is the select2 version?
Contributor
|
CR done. I've one single suggestion. |
Contributor
|
Acceptance done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #79
This could probably still be improved as the case of ACF5 with select2 v3 is now not actually covered by the tests. But for that I am waiting for #103 because it will add the infrastructure to add a CPT for which we could then switch select2 to v3.