plain edit jako alternativa ckeditoru
This commit is contained in:
		
							parent
							
								
									454ebf0088
								
							
						
					
					
						commit
						d46078a117
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		|  | @ -6,9 +6,18 @@ | ||||||
| 		<!--pre>TextNode {{item}} {{typeof(item)}}</pre--> | 		<!--pre>TextNode {{item}} {{typeof(item)}}</pre--> | ||||||
| 		<div v-if="editorShow"> | 		<div v-if="editorShow"> | ||||||
| 			<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> | ||||||
|  | 			 | ||||||
|  | 			<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="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> | ||||||
|  | 
 | ||||||
| 		<div v-else v-bind:class="changedObject"> | 		<div 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> | ||||||
|  | @ -48,6 +57,7 @@ export default { | ||||||
| 	props: { | 	props: { | ||||||
| 		item: Object, | 		item: Object, | ||||||
| 		editorShow: Boolean, | 		editorShow: Boolean, | ||||||
|  | 		plainEditShow: Boolean, | ||||||
| 		create: Boolean, | 		create: Boolean, | ||||||
| 		where: String, | 		where: String, | ||||||
| 		refnode: Object | 		refnode: Object | ||||||
|  | @ -58,6 +68,7 @@ export default { | ||||||
| 			this.currentText = ""; | 			this.currentText = ""; | ||||||
| 			this.originalText = ""; | 			this.originalText = ""; | ||||||
| 			this.editorShow = true; | 			this.editorShow = true; | ||||||
|  | 			this.plainEditShow = false; | ||||||
| 		} else { | 		} else { | ||||||
| 			this.currentText = this.item.node.text.na_web; | 			this.currentText = this.item.node.text.na_web; | ||||||
| 			this.originalText = this.item.node.text.na_web; | 			this.originalText = this.item.node.text.na_web; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Kateřina Č
						Kateřina Č