Commit 1cc790b5 by ramdayalmunda

doc editor fixes

parent 44af4271
......@@ -88,10 +88,6 @@
.a-doc-editor .body .sidebar-body{
flex: 1;
padding: 8px;
left: 20%;
right: 20%;
top: 0;
bottom: 0;
text-align: center;
overflow: auto;
display: flex;
......
......@@ -31,7 +31,8 @@ var ADocEditor = function (customConfig) {
var config = null;
var canvasList = []
const dataTypes = [
"paragraph",
"paragraph", // simple text filled line by line
"list", // sequence of line that preserves indentation
]
var dataSet = [
{
......@@ -184,10 +185,8 @@ var ADocEditor = function (customConfig) {
ctx.save()
let maxWidth = config.pageSetup.canvasWidth
let lines = []
let wordStartIndex = 0
let wordEndIndex = 0
let words = ""
let wordsLength = 0;
dataSet.formatedText = []
for (let i = 0; i < dataSet.plainContent.length; i++) {
......@@ -229,7 +228,6 @@ var ADocEditor = function (customConfig) {
}
for (let i = 0; i < dataSet.formatedText.length; i++) {
ctx.save()
ctx.font = `${dataSet.formatedText[i].fontSize}px ${dataSet.formatedText[i].fontFamily}`
......@@ -383,10 +381,9 @@ var ADocEditor = function (customConfig) {
destory,
loadContent: function (data) {
dataSet = JSON.parse(JSON.stringify(data))
reRenderPages(dataSet)
caretData.activeData = null
caretData.activeData = dataSet[0]
caretData.index = dataSet[0].plainContent.length
reRenderPages(dataSet)
},
getContent: function (){
return JSON.parse( JSON.stringify( dataSet ) )
......
......@@ -10,6 +10,12 @@ function setData() {
{
id: `1`,
type: "text",
plainContent: "Hello World!",
},
{
id: `2`,
type: "text",
plainContent: "Did you ever hear about the Great Ice Age or the Pleistocene Epoch? Less than one million years ago, in fact, some 12,000 years ago, an ice sheet many thousands of feet thick rode over Burke Mountain in a southeastward direction.",
},
......
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