Browse Source

catched preview event

pull/13499/head
malik masis 4 years ago
parent
commit
0e85c5849a
  1. 14
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/create.js

14
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/create.js

@ -90,7 +90,7 @@ $(function () {
var fileUriPrefix = "/api/cms-kit/media/"; var fileUriPrefix = "/api/cms-kit/media/";
initEditor(); initEditor();
var editor; var editor;
function initEditor() { function initEditor() {
var $editorContainer = $("#ContentEditor"); var $editorContainer = $("#ContentEditor");
@ -133,7 +133,7 @@ $(function () {
} }
}); });
} }
function uploadFile(blob, callback, source) { function uploadFile(blob, callback, source) {
var UPPY_OPTIONS = { var UPPY_OPTIONS = {
endpoint: fileUploadUri, endpoint: fileUploadUri,
@ -166,11 +166,17 @@ $(function () {
}); });
} }
$('#GeneratedWidgetText').on('change',function () { $('#GeneratedWidgetText').on('change', function () {
var txt = $('#GeneratedWidgetText').val(); var txt = $('#GeneratedWidgetText').val();
editor.insertText(txt); editor.insertText(txt);
}); });
$('.tab-item').on('click', function () {
if ($(this).attr("aria-label") == 'Preview' && editor.isMarkdownMode()) {
editor.setMarkdown(editor.getMarkdown(), true);
}
});
function createAddWidgetButton() { function createAddWidgetButton() {
const button = document.createElement('button'); const button = document.createElement('button');

Loading…
Cancel
Save