- 1 :
/**
- 2 :
* @file spacer.js
- 3 :
*/
- 4 :
import Component from '../../component.js';
- 5 :
- 6 :
/**
- 7 :
* Just an empty spacer element that can be used as an append point for plugins, etc.
- 8 :
* Also can be used to create space between elements when necessary.
- 9 :
*
- 10 :
* @extends Component
- 11 :
*/
- 12 :
class Spacer extends Component {
- 13 :
- 14 :
/**
- 15 :
* Builds the default DOM `className`.
- 16 :
*
- 17 :
* @return {string}
- 18 :
* The DOM `className` for this object.
- 19 :
*/
- 20 :
buildCSSClass() {
- 21 :
return `vjs-spacer ${super.buildCSSClass()}`;
- 22 :
}
- 23 :
- 24 :
/**
- 25 :
* Create the `Component`'s DOM element
- 26 :
*
- 27 :
* @return {Element}
- 28 :
* The element that was created.
- 29 :
*/
- 30 :
createEl(tag = 'div', props = {}, attributes = {}) {
- 31 :
if (!props.className) {
- 32 :
props.className = this.buildCSSClass();
- 33 :
}
- 34 :
- 35 :
return super.createEl(tag, props, attributes);
- 36 :
}
- 37 :
}
- 38 :
- 39 :
Component.registerComponent('Spacer', Spacer);
- 40 :
- 41 :
export default Spacer;