Commit 26bcc8ae by ramdayalmunda

formatting issue resolved

parent f07a3ace
......@@ -621,7 +621,7 @@ var ADocEditor = function (customConfig) {
caretData.style.fontColor = fontColor.value
caretData.style.bold = fontBold.classList.contains('selected')
caretData.style.italic = fontItalic.classList.contains('selected')
caretData.activeData.formatedText[caretData.index] = { ...caretData.style }
caretData.activeData.formatedText.splice(caretData.index, 0, { ...caretData.style })
caretData.activeData.plainContent = caretData.activeData.plainContent.slice(0, caretData.index) + e.key + caretData.activeData.plainContent.slice(caretData.index)
++caretData.index
......@@ -635,12 +635,14 @@ var ADocEditor = function (customConfig) {
if (dataSet[currentIndex].plainContent.length != 0) {
caretData.activeData.plainContent += dataSet[currentIndex].plainContent
caretData.activeData.formatedText.push(...dataSet[currentIndex].formatedText)
console.log()
}
dataSet.splice(currentIndex, 1)
}
} else {
caretData.activeData.plainContent = caretData.activeData.plainContent.slice(0, caretData.index - 1) + caretData.activeData.plainContent.slice(caretData.index)
caretData.index = caretData.index - 1
caretData.activeData.formatedText.splice( caretData.index, 1 )
}
}
else if (e.keyCode == 37) { // left key
......
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