Created
May 27, 2018 07:55
-
-
Save fmpwizard/58f0df6249f9584b1ea107ee553b5d72 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Delta = Quill.import('delta'); | |
var quill = new Quill('#editor-container', { | |
modules: { | |
toolbar: true | |
}, | |
placeholder: 'Compose an epic...', | |
theme: 'snow' | |
}); | |
// Store accumulated changes | |
var change = new Delta(); | |
quill.on('text-change', function(delta) { | |
change = change.compose(delta); | |
}); | |
var a = new Delta().insert('a') | |
var b = new Delta().retain(1).insert('b') | |
var c = new Delta().retain(1).insert('c') | |
var x = a.compose(b).transform(c, true) | |
quill.updateContents(a, 'api') | |
quill.updateContents(b, 'api') | |
//quill.updateContents(c, 'api') | |
quill.updateContents(x, 'api') | |
console.log('a', a.compose(b)) | |
console.log('x', x) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment