define(["require", "exports", "../base/util", "@syncfusion/ej2-base"], function (require, exports, util_1, ej2_base_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ContentRender = (function () {
function ContentRender(parent) {
this.parent = parent;
}
ContentRender.prototype.renderPanel = function () {
var rteObj = this.parent;
var div = this.parent.createElement('div', { className: 'e-rte-content', id: this.parent.getID() + 'rte-view' });
var rteContent = util_1.getEditValue(rteObj.value, rteObj);
this.editableElement = this.parent.createElement('div', {
className: 'e-content',
id: this.parent.getID() + '_rte-edit-view',
attrs: {
'contenteditable': 'true'
}
});
if (!ej2_base_1.isNullOrUndefined(this.parent.fontFamily.default)) {
this.editableElement.style.fontFamily = this.parent.fontFamily.default;
}
if (!ej2_base_1.isNullOrUndefined(this.parent.fontSize.default)) {
this.editableElement.style.fontSize = this.parent.fontSize.default;
}
this.editableElement.innerHTML = rteContent;
div.appendChild(this.editableElement);
this.setPanel(div);
rteObj.rootContainer.appendChild(div);
};
ContentRender.prototype.getPanel = function () {
return this.contentPanel;
};
ContentRender.prototype.getEditPanel = function () {
return this.editableElement;
};
ContentRender.prototype.getText = function () {
var textString = this.getEditPanel().innerText;
return textString === '\n' ? '' : textString;
};
ContentRender.prototype.setPanel = function (panel) {
this.contentPanel = panel;
};
ContentRender.prototype.getDocument = function () {
return this.getEditPanel().ownerDocument;
};
return ContentRender;
}());
exports.ContentRender = ContentRender;
});
|