mirror of
https://github.com/videojs/video.js.git
synced 2024-12-12 11:15:04 +02:00
refactor: remove un-needed contructor and function overrides (#3721)
This commit is contained in:
parent
b2c5b2a412
commit
6889e925b4
@ -15,10 +15,6 @@ import Component from './component.js';
|
|||||||
*/
|
*/
|
||||||
class BigPlayButton extends Button {
|
class BigPlayButton extends Button {
|
||||||
|
|
||||||
constructor(player, options) {
|
|
||||||
super(player, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allow sub components to stack CSS class names
|
* Allow sub components to stack CSS class names
|
||||||
*
|
*
|
||||||
|
@ -16,10 +16,6 @@ import assign from 'object.assign';
|
|||||||
*/
|
*/
|
||||||
class Button extends ClickableComponent {
|
class Button extends ClickableComponent {
|
||||||
|
|
||||||
constructor(player, options) {
|
|
||||||
super(player, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the component's DOM element
|
* Create the component's DOM element
|
||||||
*
|
*
|
||||||
|
@ -116,26 +116,6 @@ class ClickableComponent extends Component {
|
|||||||
return `vjs-control vjs-button ${super.buildCSSClass()}`;
|
return `vjs-control vjs-button ${super.buildCSSClass()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds a child component inside this clickable-component
|
|
||||||
*
|
|
||||||
* @param {String|Component} child The class name or instance of a child to add
|
|
||||||
* @param {Object=} options Options, including options to be passed to children of the child.
|
|
||||||
* @return {Component} The child component (created by this process if a string was used)
|
|
||||||
* @method addChild
|
|
||||||
*/
|
|
||||||
addChild(child, options = {}) {
|
|
||||||
// TODO: Fix adding an actionable child to a ClickableComponent; currently
|
|
||||||
// it will cause issues with assistive technology (e.g. screen readers)
|
|
||||||
// which support ARIA, since an element with role="button" cannot have
|
|
||||||
// actionable child elements.
|
|
||||||
|
|
||||||
// let className = this.constructor.name;
|
|
||||||
// log.warn(`Adding a child to a ClickableComponent (${className}) can cause issues with assistive technology which supports ARIA, since an element with role="button" cannot have actionable child elements.`);
|
|
||||||
|
|
||||||
return super.addChild(child, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable the component element
|
* Enable the component element
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user