4f45fe97567c84c9334e2bb9bd0dd44d069c4b7f
[yaffs-website] / node_modules / video.js / es5 / control-bar / spacer-controls / spacer.js
1 'use strict';
2
3 exports.__esModule = true;
4
5 var _component = require('../../component.js');
6
7 var _component2 = _interopRequireDefault(_component);
8
9 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
10
11 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
13 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
14
15 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**
16                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 * @file spacer.js
17                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 */
18
19
20 /**
21  * Just an empty spacer element that can be used as an append point for plugins, etc.
22  * Also can be used to create space between elements when necessary.
23  *
24  * @extends Component
25  */
26 var Spacer = function (_Component) {
27   _inherits(Spacer, _Component);
28
29   function Spacer() {
30     _classCallCheck(this, Spacer);
31
32     return _possibleConstructorReturn(this, _Component.apply(this, arguments));
33   }
34
35   /**
36    * Builds the default DOM `className`.
37    *
38    * @return {string}
39    *         The DOM `className` for this object.
40    */
41   Spacer.prototype.buildCSSClass = function buildCSSClass() {
42     return 'vjs-spacer ' + _Component.prototype.buildCSSClass.call(this);
43   };
44
45   /**
46    * Create the `Component`'s DOM element
47    *
48    * @return {Element}
49    *         The element that was created.
50    */
51
52
53   Spacer.prototype.createEl = function createEl() {
54     return _Component.prototype.createEl.call(this, 'div', {
55       className: this.buildCSSClass()
56     });
57   };
58
59   return Spacer;
60 }(_component2['default']);
61
62 _component2['default'].registerComponent('Spacer', Spacer);
63
64 exports['default'] = Spacer;