Skip to content

Update title and classnames (when option enabled) from select on update - #2319

Open
isochronous wants to merge 9 commits into
harvesthq:mainfrom
isochronous:keep_inherited_attrs_updated
Open

isochronous wants to merge 9 commits into
harvesthq:mainfrom
isochronous:keep_inherited_attrs_updated

Conversation

@isochronous

Copy link
Copy Markdown

This Fixes #2232 and Fixes #2311.
I simply extracted the logic that determines which classnames to apply to the container into a separate method, did the same for the logic that copies the title attribute, then replaced the original logic with calls to those two methods and added the same calls to the results_build method in the appropriate places so that classes and the title will be updated from the select on update.

I also significantly reorganized the spec files to make them more granular. I originally had the whole virtual DOM being reconstructed and torn down before and after each test, but ran into some issues in prototype when using that approach that I was unable to figure out. Since none of the current tests (or the tests I added) actually conflict with each other, I just organized the tests so that the virtual DOM and the chosen instance are only created once before any test and then destroyed after all tests.

Both prototype and jQuery versions were updated, and all tests are passing.

Modified chosen so that if inherit_select_classes is set to true, then
classes will be copied from the select to the chosen container every
time "chosen:updated" is triggered.
Also added logic to ALWAYS copy the title attribute from the select to
the container whenever "chosen:updated" is triggered.
Updated both jQuery and prototype versions
Heavily refactored unit tests for better granularity
All jQuery unit tests are passing, but two prototype unit tests are
failing for an unknown reason (exception being thrown from a prototype
method, it's not just a failed assertion).
…on update

Modified chosen so that if inherit_select_classes is set to true, then
classes will be copied from the select to the chosen container every
time "chosen:updated" is triggered.

Add logic to ALWAYS copy the title attribute from the select to
the container whenever "chosen:updated" is triggered.

Updated both jQuery and prototype versions
Heavily refactored unit tests for better granularity
All jQuery unit tests are passing, but two prototype unit tests are
failing for an unknown reason (exception being thrown from a prototype
method, it's not just a failed assertion).
Cleaned up some duplicate logic that I'd left in the prototype version
Significantly reorganized both spec files
Got all unit tests working for both versions
Remove the x86-mingw32 entry from the PLATFORMS list
@thirtysixwind

Copy link
Copy Markdown

hello

@isochronous

Copy link
Copy Markdown
Author

Hi there

@isochronous

Copy link
Copy Markdown
Author

In case anyone wants these versions of chosen before this pull request is accepted (assuming it is), you can find both the jQuery and prototype versions here: https://gist.github.com/isochronous/541fa49aa34f7f5b20a3

@isochronous

Copy link
Copy Markdown
Author

Is anyone paying attention to these pull requests?

…on update

Modified chosen so that if inherit_select_classes is set to true, then
classes will be copied from the select to the chosen container every
time "chosen:updated" is triggered.

Add logic to ALWAYS copy the title attribute from the select to
the container whenever "chosen:updated" is triggered.

Updated both jQuery and prototype versions
Heavily refactored unit tests for better granularity
All jQuery unit tests are passing, but two prototype unit tests are
failing for an unknown reason (exception being thrown from a prototype
method, it's not just a failed assertion).
Cleaned up some duplicate logic that I'd left in the prototype version
Significantly reorganized both spec files
Got all unit tests working for both versions
Remove the x86-mingw32 entry from the PLATFORMS list

This branch has not been deployed

No deployments
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.

Update trigger should update title attribute from original select chosen: updated does not pick up css-class.

2 participants