Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
150940 | Jan 25,2020 02:59 AM UTC | Feb 26,2020 05:04 AM UTC | Vue | 12 |
![]() |
Tags: RichTextEditor |
<script>
export default Vue.extend({
data: function() {
return {
methods: {
onCreate: function(e) {
this.customBtn = document.getElementById("custom_tbar");
this.$refs.dialogObj.ej2Instances.target = document.getElementById(
"rteSection"
);
var proxy = this;
this.customBtn.onclick = function(e) {
proxy.$refs.rteObj.ej2Instances.contentModule.getEditPanel().focus();
proxy.range = proxy.selection.getRange(document);
proxy.saveSelection = proxy.selection.save(proxy.range, document);
proxy.$refs.dialogObj.ej2Instances.content = document.getElementById(
"rteSpecial_char"
);
proxy.$refs.dialogObj.ej2Instances.dataBind();
proxy.$refs.dialogObj.show();
};
},
onInsert: function() {
debugger;
var insertHTMLContent;
if (this.$refs.insertMarkup.ej2Instances.value === "Markup1") {
insertHTMLContent = "<p>Markup 1 content</p>";
} else {
insertHTMLContent = "<p>Markup 2 content</p>";
}
if (insertHTMLContent !== "") {
if (
this.$refs.rteObj.ej2Instances.formatter.getUndoRedoStack().length ===
0
) {
this.$refs.rteObj.ej2Instances.formatter.saveData();
}
this.saveSelection.restore();
this.$refs.rteObj.ej2Instances.executeCommand(
"insertHTML",
insertHTMLContent
);
this.$refs.rteObj.ej2Instances.formatter.saveData();
}
this.dialogOverlay();
},
provide: {
richtexteditor: [Toolbar, Link, Image, Count, HtmlEditor, QuickToolbar]
}
});
</script>
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.