playable
Version:
Video player based on HTML5Video
39 lines • 1.81 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var view_1 = (0, tslib_1.__importDefault)(require("../core/view"));
var templates_1 = require("./templates");
var htmlToElement_1 = (0, tslib_1.__importDefault)(require("../core/htmlToElement"));
var main_ui_block_scss_1 = (0, tslib_1.__importDefault)(require("./main-ui-block.scss"));
var MainUIBlockView = /** @class */ (function (_super) {
(0, tslib_1.__extends)(MainUIBlockView, _super);
function MainUIBlockView(config) {
var _this = _super.call(this) || this;
_this._initDOM(config.elements);
return _this;
}
MainUIBlockView.prototype._initDOM = function (elements) {
this._$rootElement = (0, htmlToElement_1.default)((0, templates_1.mainUIBlockTemplate)({
styles: this.styleNames,
}));
var $tooltipContainerWrapper = document.createElement('div');
$tooltipContainerWrapper.classList.add(this.styleNames.tooltipContainerWrapper);
$tooltipContainerWrapper.appendChild(elements.tooltipContainer);
this._$rootElement.appendChild(elements.topBlock);
this._$rootElement.appendChild($tooltipContainerWrapper);
this._$rootElement.appendChild(elements.bottomBlock);
};
MainUIBlockView.prototype.getElement = function () {
return this._$rootElement;
};
MainUIBlockView.prototype.destroy = function () {
if (this._$rootElement.parentNode) {
this._$rootElement.parentNode.removeChild(this._$rootElement);
}
this._$rootElement = null;
};
return MainUIBlockView;
}(view_1.default));
MainUIBlockView.extendStyleNames(main_ui_block_scss_1.default);
exports.default = MainUIBlockView;
//# sourceMappingURL=main-ui-block.view.js.map