Commit 4a5400c4 by ramdayalmunda

minor position fixes

parent e825c35b
...@@ -29,6 +29,7 @@ var ADocEditor = function (customConfig) { ...@@ -29,6 +29,7 @@ var ADocEditor = function (customConfig) {
activeData: dataSet[0], activeData: dataSet[0],
index: dataSet[0].plainContent.length, index: dataSet[0].plainContent.length,
interval: null, interval: null,
intervalDuration: 800,
blink: false, blink: false,
canvasIndex: 0, canvasIndex: 0,
caretSize: 28, caretSize: 28,
...@@ -57,7 +58,7 @@ var ADocEditor = function (customConfig) { ...@@ -57,7 +58,7 @@ var ADocEditor = function (customConfig) {
caretData.interval = setInterval(() => { caretData.interval = setInterval(() => {
caretData.blink = !caretData.blink caretData.blink = !caretData.blink
reRenderPages(dataSet, true) reRenderPages(dataSet, true)
}, 1000) }, caretData.intervalDuration)
} }
function reRenderPages(dataList, blinking = false) { function reRenderPages(dataList, blinking = false) {
...@@ -83,7 +84,7 @@ var ADocEditor = function (customConfig) { ...@@ -83,7 +84,7 @@ var ADocEditor = function (customConfig) {
if (dataList[i].id == caretData.activeData.id) { if (dataList[i].id == caretData.activeData.id) {
caretData.canvasIndex = canvasIndex caretData.canvasIndex = canvasIndex
calculateCaretPosition() caretData = { ...caretData, ...calculateCaretPosition() }
} }
} }
...@@ -109,6 +110,13 @@ var ADocEditor = function (customConfig) { ...@@ -109,6 +110,13 @@ var ADocEditor = function (customConfig) {
} }
} }
function calculateCaretPosition() {
return {
x: 146,
y: 21
}
}
function createCanvas() { function createCanvas() {
let canvas = document.createElement('canvas') let canvas = document.createElement('canvas')
canvas.width = config.pageSetup.canvasWidth canvas.width = config.pageSetup.canvasWidth
...@@ -151,15 +159,9 @@ var ADocEditor = function (customConfig) { ...@@ -151,15 +159,9 @@ var ADocEditor = function (customConfig) {
caretData.interval = setInterval(() => { caretData.interval = setInterval(() => {
caretData.blink = !caretData.blink caretData.blink = !caretData.blink
reRenderPages(dataSet, true) reRenderPages(dataSet, true)
}, 1000) }, caretData.intervalDuration)
} }
function calculateCaretPosition() {
return {
x: 50,
y: 21
}
}
function mousedownHandler(e) { function mousedownHandler(e) {
e.target.focus({ preventScroll: true }); e.target.focus({ preventScroll: true });
......
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