-
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
Moving seekbar event handler bindings into a function #5097
Moving seekbar event handler bindings into a function #5097
Conversation
- Makes it easier to extend the seekbar and change modify the default event handlers no message
Assuming this gets in, will this and #5055 make it into 6.x or are these only for 7.x? Is there anything I need to do for them to get into 6.x? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a reasonable change.
* | ||
* @private | ||
*/ | ||
setEventHandlers_(player, options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would consider removing passing in the player and options and instead update the code to use this.player_
and this.options_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure thing.
- Using member variables instead of passing through arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Makes it easier to extend the seekbar and change the default event handlers. If you extend the seekbar component you can choose to override setEventHandlers_ or keep it default. If you do override setEventHandlers_ and call super() in the constructor, you get your own event handlers + the functionality provided by Slider.
Makes it easier to extend the seekbar and change the default event handlers. If you extend the seekbar component you can choose to override setEventHandlers_ or keep it default. If you do override setEventHandlers_ and call super() in the constructor, you get your own event handlers + the functionality provided by Slider.
Description
Move all eventHandler bindings into a function.
Specific Changes proposed
This allows for easier customisation of the the seekbar component.
If you extend the seekbar component you can choose to override
setEventHandlers_
or keep it default.If you do override
setEventHandlers_
and callsuper()
in the constructor, you get your own event handlers + the functionality provided bySlider
Currently extending slider and wanting different bindings, means either copy pasting from the existing slider or writing a function to undo the bindings (which is not possible in this case since they are anonymous functions).
Requirements Checklist