Add back @roschaefer changes

- maintain reactive placeholders
This commit is contained in:
mattwr18 2019-12-16 11:42:37 +01:00
parent 70c63297d4
commit 83ab648e93

View File

@ -24,7 +24,6 @@
import { Editor, EditorContent } from 'tiptap' import { Editor, EditorContent } from 'tiptap'
import { History } from 'tiptap-extensions' import { History } from 'tiptap-extensions'
import linkify from 'linkify-it' import linkify from 'linkify-it'
import stringHash from 'string-hash'
import { replace, build } from 'xregexp/xregexp-all.js' import { replace, build } from 'xregexp/xregexp-all.js'
import * as key from '../../constants/keycodes' import * as key from '../../constants/keycodes'
@ -108,17 +107,6 @@ export default {
}, },
}, },
watch: { watch: {
value: {
immediate: true,
handler: function(content, old) {
const contentHash = stringHash(content)
if (!content || contentHash === this.lastValueHash) {
return
}
this.lastValueHash = contentHash
this.$nextTick(() => this.editor.setContent(content))
},
},
placeholder: { placeholder: {
immediate: true, immediate: true,
handler: function(val) { handler: function(val) {
@ -247,11 +235,7 @@ export default {
}, },
onUpdate(e) { onUpdate(e) {
const content = e.getHTML() const content = e.getHTML()
const contentHash = stringHash(content) this.$emit('input', content)
if (contentHash !== this.lastValueHash) {
this.lastValueHash = contentHash
this.$emit('input', content)
}
}, },
toggleLinkInput(attrs, element) { toggleLinkInput(attrs, element) {
if (!this.isLinkInputActive && attrs && element) { if (!this.isLinkInputActive && attrs && element) {