Open dw2 opened 8 years ago
This resolves issue #66
thanks @dw2! i now see what you're sayin. :)
wraithgar and I had a long thread with another user about permitting the use of mixed types. at current time, we are hesistant to support multiple option types in the options set, per discussion here. also, mixing of some types are just plain incompatible. however, we definitely do want to support numbers only. can't believe this has never come up before!
very grateful for your PR. for the time being, would you be kind enough to:
.find
and be more functional about it, thats ok too. :)Can you explain what you mean by "common types"
apologies for the lack of clarity. "find the matching option within common types?" should have read "adjust the code to find the matching option assuming that the options in this.options
are homogeneous. e.g. 'remove support for mixed option sets'."
and using ".find"?
if you don't want to use the status quo for
loop, you're welcome to find the matching option using this.options.find(function(option) { ... })
. just conveying no need to maintain the status quo if you didnt care to.
I removed support for mixed option types and added a test for numbers when using [[number','label'], ...
option types. However I am unable to run the test locally because I cannot get zuul installed properly to run the test suite.
checked out branch as of 82ad163 and the tests pass locally for me so let's not let that be a blocker here, I'm currently trying to help doug get zuul running via other messaging channels.
@wraithgar helped me out via Twitter DM. I can run tests locally now, but am still having separate issues with zuul. I'm taking this as a win. Thank you @wraithgar and @cdaringe for the help and feedback. Let me know if you need anything else for this PR. I hope to contribute more in the future.
Also, thank you @jweakley for helping me troubleshoot NPM issues.
This change will allow model attributes with type 'number' to work with the select view. As an added bonus, this will also allow for mixed option sets (i.e.
[[0,'First'], 2, 3, [4,'Fourth'], 5, ...]
).