Browse Source

TreeNode editor | plain edit (snad) funguje

export_seznamu_prednasek
Kateřina Č 4 years ago
parent
commit
5d433509e4
  1. 15
      vue_frontend/src/components/TextNode.vue

15
vue_frontend/src/components/TextNode.vue

@ -4,26 +4,29 @@
</div> </div>
<div v-else class="textnode"> <div v-else class="textnode">
<!--pre>TextNode {{item}} {{typeof(item)}}</pre--> <!--pre>TextNode {{item}} {{typeof(item)}}</pre-->
<div v-if="editorShow"> <template v-if="editorShow">
<div v-if="plainEditShow"> <div v-if="plainEditShow">
<textarea id="textarea" v-model="currentText" rows="8" cols="50"></textarea> <textarea id="textarea" v-model="currentText" rows="8" cols="50"></textarea>
<br>
<button v-on:click="plainEditShow=!plainEditShow">Editovat v editoru</button>
<button v-on:click="saveText">Uložit</button>
<button v-on:click="currentText = originalText;editorShow=!editorShow;">Zahodit úpravy</button>
</div> </div>
<div v-else> <div v-else>
<component v-bind:is="editorComponent" :editor="editor" v-model="currentText" :config="editorConfig"></component> <component v-bind:is="editorComponent" :editor="editor" v-model="currentText" :config="editorConfig"></component>
<div>
<button v-on:click="plainEditShow=!plainEditShow">Editovat HTML</button> <button v-on:click="plainEditShow=!plainEditShow">Editovat HTML</button>
<button v-on:click="saveText">Uložit</button> <button v-on:click="saveText">Uložit</button>
<button v-on:click="currentText = originalText;editorShow=!editorShow;">Zahodit úpravy</button> <button v-on:click="currentText = originalText;editorShow=!editorShow;">Zahodit úpravy</button>
<div>
</div> </template>
<div v-else v-bind:class="changedObject"> <template v-else v-bind:class="changedObject">
<p v-html="currentText"></p> <p v-html="currentText"></p>
<button v-on:click="editorShow=!editorShow">Upravit</button> <button v-on:click="editorShow=!editorShow">Upravit</button>
</div> </template>
</div> </div>
</template> </template>

Loading…
Cancel
Save