-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Array traversing for children opts - closes #1070 #1093
Conversation
Cool! I'm going to wait until @heff is back in town to dive in, but at first glance there seems to be some weird stuff going on with indentation. Mind double checking on that and making sure things match the rest of the project in terms of style convention? |
Thanks for this. I get the need for this, since chrome will reorder object keys and potentially change the order of children, which is bad. This should definitely be fixed. The changes in this pull request are a little hard to track because it looks like your editor changed a lot of the spacing around things. Can you remove the spacing changes that don't specifically apply to this? |
@heff I added in a commit to fix the spacing issues. The actual code I checked in that is new is very little:
|
@heff Here is a link with all the whitespace removed: https://github.com/videojs/video.js/pull/1093/files?w=1 Github has the feature baked in of adding ?w=1 onto the end to ignore all whitespace changes. |
Going to think in the open a bit here... The order of components is important, and I'm surprised we haven't run into issues with Chrome and the default So an array would be better to use, however there's currently a feature of using an object here that allows you to disable just one of the child components instead of rebuilding the whole children list. e.g. the following would block the bigPlayButton from being added
If we used an array for the As far as the array items, when they include options, I think it'd be better if we include an component option setting to provide the class type of the child. Possibly just
As opposed to the originally suggested:
As far as adding How do you feel about those updates? |
Just for reference, videojs/videojs-youtube#74 is an example of someone using the |
Updates for videojs#1093
I originally didn't add in the alternate syntax for the array as I was trying to maintain the same style that was used in videojs, but I definitely like this a lot better, since it removes the unnecessary overhead. |
Awesome, thanks! |
This should allow two additional ways to specify children for turning on specific components and ordering them:
There is no an additional
vjs.each
, which can handle either objects or arrays