Commit 632d63be by ramdayalmunda

enter event in between text

parent 6c606c3b
......@@ -566,11 +566,18 @@ var ADocEditor = function (customConfig) {
tabCount: caretData.activeData.tabCount,
style: { ...caretData.activeData.style }
}
dataObj.plainContent = caretData.activeData.plainContent.slice(caretData.index)
caretData.activeData.plainContent = caretData.activeData.plainContent.slice(0,caretData.index)
dataObj.formatedText = caretData.activeData.formatedText.splice(caretData.index)
let activeDataIndex = dataList.findIndex( item => item.id==caretData.activeData.id )
dataList.splice( activeDataIndex+1, 0, dataObj )
if (e.ctrlKey || e.metaKey) dataObj.newPage = true
caretData.index = 0
caretData.activeData = dataObj
if (dataObj.type == 0) dataObj.tabCount = 0
dataList.push(dataObj)
// dataList.push(dataObj)
}
else if (e.key.length == 1 && !e.ctrlKey && !e.metaKey) { // displayable text
// ***** DISPLAYABLE TEXT **** //
......@@ -848,6 +855,7 @@ var ADocEditor = function (customConfig) {
config = JSON.parse( JSON.stringify( data.config ) )
caretData = JSON.parse( JSON.stringify( data.caretData ) )
caretData.activeData = dataList[data.caretData.activeDataIndex]
caretData.blink = false
reRenderCanvas()
},
addFonts,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment