Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
a-doc-editor
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ramdayal Munda
a-doc-editor
Commits
4a5400c4
Commit
4a5400c4
authored
Nov 29, 2023
by
ramdayalmunda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor position fixes
parent
e825c35b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
a-doc-editor.js
dist/assets/a-doc-editor.js
+11
-9
No files found.
dist/assets/a-doc-editor.js
View file @
4a5400c4
...
@@ -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
ca
lculateCaretPosition
()
ca
retData
=
{
...
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
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment