3 exports.__esModule = true;
5 var _button = require('./button');
7 var _button2 = _interopRequireDefault(_button);
9 var _component = require('./component');
11 var _component2 = _interopRequireDefault(_component);
13 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
15 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
17 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; }
19 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; } /**
20 * @file close-button.js
25 * The `CloseButton` is a `{@link Button}` that fires a `close` event when
30 var CloseButton = function (_Button) {
31 _inherits(CloseButton, _Button);
34 * Creates an instance of the this class.
36 * @param {Player} player
37 * The `Player` that this class should be attached to.
39 * @param {Object} [options]
40 * The key/value store of player options.
42 function CloseButton(player, options) {
43 _classCallCheck(this, CloseButton);
45 var _this = _possibleConstructorReturn(this, _Button.call(this, player, options));
47 _this.controlText(options && options.controlText || _this.localize('Close'));
52 * Builds the default DOM `className`.
55 * The DOM `className` for this object.
59 CloseButton.prototype.buildCSSClass = function buildCSSClass() {
60 return 'vjs-close-button ' + _Button.prototype.buildCSSClass.call(this);
64 * This gets called when a `CloseButton` gets clicked. See
65 * {@link ClickableComponent#handleClick} for more information on when this will be
68 * @param {EventTarget~Event} event
69 * The `keydown`, `tap`, or `click` event that caused this function to be
74 * @fires CloseButton#close
78 CloseButton.prototype.handleClick = function handleClick(event) {
81 * Triggered when the a `CloseButton` is clicked.
83 * @event CloseButton#close
84 * @type {EventTarget~Event}
86 * @property {boolean} [bubbles=false]
87 * set to false so that the close event does not
88 * bubble up to parents if there is no listener
90 this.trigger({ type: 'close', bubbles: false });
94 }(_button2['default']);
96 _component2['default'].registerComponent('CloseButton', CloseButton);
97 exports['default'] = CloseButton;