Browse Source

plain edit jako alternativa ckeditoru

export_seznamu_prednasek
Kateřina Č 4 years ago
parent
commit
d46078a117
  1. 11
      vue_frontend/src/components/TextNode.vue

11
vue_frontend/src/components/TextNode.vue

@ -6,9 +6,18 @@
<!--pre>TextNode {{item}} {{typeof(item)}}</pre-->
<div v-if="editorShow">
<component v-bind:is="editorComponent" :editor="editor" v-model="currentText" :config="editorConfig"></component>
<button v-on:click="plainEditShow=!plainEditShow">Editovat HTML</button>
<div v-if="plainEditShow">
<textarea id="textarea" v-model="currentText" rows="8" cols="50"></textarea>
</div>
<button v-on:click="saveText">Uložit</button>
<button v-on:click="currentText = originalText;editorShow=!editorShow;">Zahodit úpravy</button>
</div>
<div v-else v-bind:class="changedObject">
<p v-html="currentText"></p>
<button v-on:click="editorShow=!editorShow">Upravit</button>
@ -48,6 +57,7 @@ export default {
props: {
item: Object,
editorShow: Boolean,
plainEditShow: Boolean,
create: Boolean,
where: String,
refnode: Object
@ -58,6 +68,7 @@ export default {
this.currentText = "";
this.originalText = "";
this.editorShow = true;
this.plainEditShow = false;
} else {
this.currentText = this.item.node.text.na_web;
this.originalText = this.item.node.text.na_web;

Loading…
Cancel
Save