Add All and Remove All buttons for the select_advanced dropdowns #1331
+111
−3
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.
This code is functional for the site I am working on. So I figured I would submit it for a more expert review.
Basically it allows you to define a bulk_clone boolean parameter for the advanced select dialog. Then in the association editor ( I'll submit a pull request over there too), you can add all possible associations or remove them.
I am unhappy with the JS code that calls mousedown() event to remove the items and then to re. I would much rather trigger the method to remove an item directly without causing the drop down to open, but the minimized select2 code blocked my plans for that. For now. That said, since it is fully functional, perhaps the way it is written is actually good enough to deploy.
It may be that this code could be used for other field types as well. I've only done testing with the select field in use with association of taxonomies. I've not put any thoughts into whether this could work for another type of field.
Please let me know if you think this code needs any alterations.