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
78778c19
Commit
78778c19
authored
Dec 11, 2023
by
ramdayalmunda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enter event in between the lines completed
parent
2767b644
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
a-doc-editor.js
dist/assets/a-doc-editor.js
+6
-8
No files found.
dist/assets/a-doc-editor.js
View file @
78778c19
...
@@ -323,7 +323,6 @@ var ADocEditor = function (customConfig) {
...
@@ -323,7 +323,6 @@ var ADocEditor = function (customConfig) {
// to render caret
// to render caret
function
renderCaret
()
{
function
renderCaret
()
{
console
.
log
(
'renderCaret'
,
caretData
.
canvasIndex
,
caretData
.
index
)
let
ctx
=
canvasList
[
caretData
.
canvasIndex
].
el
.
getContext
(
'2d'
,
{
willReadFrequently
:
true
})
let
ctx
=
canvasList
[
caretData
.
canvasIndex
].
el
.
getContext
(
'2d'
,
{
willReadFrequently
:
true
})
let
activeTextData
=
caretData
.
activeData
.
formatedText
[
caretData
.
index
-
1
]
let
activeTextData
=
caretData
.
activeData
.
formatedText
[
caretData
.
index
-
1
]
if
(
!
activeTextData
)
activeTextData
=
caretData
.
activeData
.
style
if
(
!
activeTextData
)
activeTextData
=
caretData
.
activeData
.
style
...
@@ -418,11 +417,12 @@ var ADocEditor = function (customConfig) {
...
@@ -418,11 +417,12 @@ var ADocEditor = function (customConfig) {
plainContent
:
""
,
plainContent
:
""
,
style
:
JSON
.
parse
(
JSON
.
stringify
(
style
))
style
:
JSON
.
parse
(
JSON
.
stringify
(
style
))
}
}
newLineData
.
style
.
y
+=
newLineData
.
style
.
fontSize
newLineData
.
plainContent
=
caretData
.
activeData
.
plainContent
.
slice
(
caretData
.
index
)
newLineData
.
style
.
x
=
0
caretData
.
activeData
.
plainContent
=
caretData
.
activeData
.
plainContent
.
slice
(
0
,
caretData
.
index
)
newLineData
.
style
.
width
=
0
let
currentDataIndex
=
dataSet
.
findIndex
(
item
=>
item
.
id
==
caretData
.
activeData
.
id
)
dataSet
.
push
(
newLineData
)
dataSet
.
splice
(
currentDataIndex
+
1
,
0
,
newLineData
)
caretData
.
activeData
=
newLineData
caretData
.
activeData
=
dataSet
[
currentDataIndex
+
1
]
caretData
.
y
+=
style
.
fontSize
caretData
.
index
=
0
caretData
.
index
=
0
}
}
}
}
...
@@ -572,9 +572,7 @@ var ADocEditor = function (customConfig) {
...
@@ -572,9 +572,7 @@ var ADocEditor = function (customConfig) {
charIndex
++
charIndex
++
}
}
console
.
log
(
"last line:"
,
caretData
.
canvasIndex
)
}
}
console
.
log
(
'full break;'
,
caretData
.
canvasIndex
,
caretData
.
index
)
...
...
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