define(["require", "exports", "@syncfusion/ej2-popups", "../base/constant", "@syncfusion/ej2-base", "../base/classes"], function (require, exports, ej2_popups_1, events, ej2_base_1, classes) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var QuickPopupRenderer = (function () {
function QuickPopupRenderer(parent) {
this.parent = parent;
}
QuickPopupRenderer.prototype.renderPopup = function (type) {
this.type = type;
var baseClass = this.type === 'Inline' ? classes.CLS_QUICK_POP + ' ' + classes.CLS_INLINE_POP : classes.CLS_QUICK_POP;
var baseId = this.type === 'Inline' ? '_Inline_Quick_Popup' : '_Quick_Popup';
var popupId = ej2_base_1.getUniqueID(this.parent.getID() + '_' + type + baseId);
this.popupElement = this.parent.createElement('div', { className: baseClass + ' ' + classes.CLS_RTE_ELEMENTS });
this.popupElement.setAttribute('aria-owns', this.parent.getID());
this.popupElement.id = popupId;
var tip = this.parent.createElement('div', { className: classes.CLS_QUICK_TBAR_TIP_POINTER });
this.popupElement.appendChild(tip);
this.popup = this.createPopup(this.type, this.popupElement);
return this.popup;
};
QuickPopupRenderer.prototype.quickToolbarOpen = function () {
var args = this.popup;
this.parent.trigger(events.quickToolbarOpen, args);
};
QuickPopupRenderer.prototype.createPopup = function (type, element) {
var popup;
switch (type) {
case 'Inline':
case 'Text':
case 'Link':
case 'Audio':
popup = new ej2_popups_1.Popup(element, {
viewPortElement: this.parent.iframeSettings.enable ? null
: this.parent.contentModule.getEditPanel(),
zIndex: 9,
collision: { X: 'fit', Y: 'flip' },
position: { X: 'left', Y: 'top' },
actionOnScroll: 'none',
open: this.quickToolbarOpen.bind(this)
});
break;
case 'Video':
case 'Image':
case 'Table':
popup = new ej2_popups_1.Popup(element, {
viewPortElement: this.parent.iframeSettings.enable ? null
: this.parent.contentModule.getEditPanel(),
zIndex: 9,
collision: { X: 'fit', Y: 'flip' },
position: { X: 'left', Y: 'top' },
actionOnScroll: 'none',
open: this.quickToolbarOpen.bind(this)
});
break;
}
return popup;
};
return QuickPopupRenderer;
}());
exports.QuickPopupRenderer = QuickPopupRenderer;
});
|