Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
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
Vũ Hoàng Anh
canifa_note
Commits
c60c58ed
Commit
c60c58ed
authored
Sep 19, 2022
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: fix memo content click handler
parent
366afdd1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
14 deletions
+7
-14
ArchivedMemo.tsx
web/src/components/ArchivedMemo.tsx
+1
-1
DailyMemo.tsx
web/src/components/DailyMemo.tsx
+1
-1
Memo.tsx
web/src/components/Memo.tsx
+1
-3
MemoCardDialog.tsx
web/src/components/MemoCardDialog.tsx
+1
-6
MemoContent.tsx
web/src/components/MemoContent.tsx
+2
-2
memo-content.less
web/src/less/memo-content.less
+1
-1
No files found.
web/src/components/ArchivedMemo.tsx
View file @
c60c58ed
...
...
@@ -72,7 +72,7 @@ const ArchivedMemo: React.FC<Props> = (props: Props) => {
</
span
>
</
div
>
</
div
>
<
MemoContent
c
lassName=
"memo-content-wrapper"
c
ontent=
{
memo
.
content
}
/>
<
MemoContent
content=
{
memo
.
content
}
/>
<
MemoResources
memo=
{
memo
}
/>
</
div
>
);
...
...
web/src/components/DailyMemo.tsx
View file @
c60c58ed
...
...
@@ -28,7 +28,7 @@ const DailyMemo: React.FC<Props> = (props: Props) => {
<
div
className=
"time-wrapper"
>
<
span
className=
"normal-text"
>
{
memo
.
timeStr
}
</
span
>
</
div
>
<
MemoContent
c
lassName=
"memo-content-container"
c
ontent=
{
memo
.
content
}
displayConfig=
{
displayConfig
}
/>
<
MemoContent
content=
{
memo
.
content
}
displayConfig=
{
displayConfig
}
/>
<
div
className=
"split-line"
></
div
>
</
div
>
);
...
...
web/src/components/Memo.tsx
View file @
c60c58ed
...
...
@@ -35,7 +35,6 @@ const Memo: React.FC<Props> = (props: Props) => {
const
{
t
,
i18n
}
=
useTranslation
();
const
[
createdAtStr
,
setCreatedAtStr
]
=
useState
<
string
>
(
getFormatedMemoCreatedAtStr
(
memo
.
createdTs
,
i18n
.
language
));
const
memoContainerRef
=
useRef
<
HTMLDivElement
>
(
null
);
const
memoContentContainerRef
=
useRef
<
HTMLDivElement
>
(
null
);
const
isVisitorMode
=
userService
.
isVisitorMode
();
useEffect
(()
=>
{
...
...
@@ -122,7 +121,7 @@ const Memo: React.FC<Props> = (props: Props) => {
}
const
status
=
targetEl
.
dataset
?.
value
;
const
todoElementList
=
[...(
memoCont
entCont
ainerRef
.
current
?.
querySelectorAll
(
`span.todo-block[data-value=
${
status
}
]`
)
??
[])];
const
todoElementList
=
[...(
memoContainerRef
.
current
?.
querySelectorAll
(
`span.todo-block[data-value=
${
status
}
]`
)
??
[])];
for
(
const
element
of
todoElementList
)
{
if
(
element
===
targetEl
)
{
const
index
=
indexOf
(
todoElementList
,
element
);
...
...
@@ -207,7 +206,6 @@ const Memo: React.FC<Props> = (props: Props) => {
</
div
>
</
div
>
<
MemoContent
className=
""
content=
{
memo
.
content
}
onMemoContentClick=
{
handleMemoContentClick
}
onMemoContentDoubleClick=
{
handleMemoContentDoubleClick
}
...
...
web/src/components/MemoCardDialog.tsx
View file @
c60c58ed
...
...
@@ -178,12 +178,7 @@ const MemoCardDialog: React.FC<Props> = (props: Props) => {
</
div
>
</
div
>
<
div
className=
"memo-container"
>
<
MemoContent
className=
""
displayConfig=
{
{
enableExpand
:
false
}
}
content=
{
memo
.
content
}
onMemoContentClick=
{
handleMemoContentClick
}
/>
<
MemoContent
displayConfig=
{
{
enableExpand
:
false
}
}
content=
{
memo
.
content
}
onMemoContentClick=
{
handleMemoContentClick
}
/>
<
MemoResources
memo=
{
memo
}
/>
</
div
>
<
div
className=
"layer-container"
></
div
>
...
...
web/src/components/MemoContent.tsx
View file @
c60c58ed
...
...
@@ -14,8 +14,8 @@ export interface DisplayConfig {
}
interface
Props
{
className
:
string
;
content
:
string
;
className
?:
string
;
displayConfig
?:
Partial
<
DisplayConfig
>
;
onMemoContentClick
?:
(
e
:
React
.
MouseEvent
)
=>
void
;
onMemoContentDoubleClick
?:
(
e
:
React
.
MouseEvent
)
=>
void
;
...
...
@@ -78,7 +78,7 @@ const MemoContent: React.FC<Props> = (props: Props) => {
};
return
(
<
div
className=
{
`memo-content-wrapper ${className}`
}
>
<
div
className=
{
`memo-content-wrapper ${className
|| ""
}`
}
>
<
div
ref=
{
memoContentContainerRef
}
className=
{
`memo-content-text ${state.expandButtonStatus === 0 ? "expanded" : ""}`
}
...
...
web/src/less/memo-content.less
View file @
c60c58ed
...
...
@@ -22,7 +22,7 @@
}
.tag-span {
@apply inline-block w-auto font-mono text-blue-600;
@apply inline-block w-auto font-mono text-blue-600
cursor-pointer
;
}
.memo-link-text {
...
...
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