Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
n8n_ai_assistant
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
n8n_ai_assistant
Commits
d3f55e2b
Commit
d3f55e2b
authored
Apr 12, 2024
by
Domi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: chatdoc drag and drop
parent
fcf8d461
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
ChatDocsAddon.vue
src/components/chatdocs/ChatDocsAddon.vue
+16
-7
ChatDocsPanel.vue
src/components/chatdocs/ChatDocsPanel.vue
+1
-2
No files found.
src/components/chatdocs/ChatDocsAddon.vue
View file @
d3f55e2b
...
@@ -31,7 +31,7 @@ const siteConfig: SiteConfig = reactive({
...
@@ -31,7 +31,7 @@ const siteConfig: SiteConfig = reactive({
selector
:
null
,
selector
:
null
,
})
})
let
timer
=
0
let
count
=
0
watchEffect
(()
=>
{
watchEffect
(()
=>
{
const
{
valid
,
rect
,
tx
,
ty
}
=
position
const
{
valid
,
rect
,
tx
,
ty
}
=
position
...
@@ -43,11 +43,19 @@ watchEffect(() => {
...
@@ -43,11 +43,19 @@ watchEffect(() => {
}
}
})
})
function
onDrag
Over
(
e
:
DragEvent
)
{
function
onDrag
Enter
(
)
{
if
(
!
siteConfig
.
selector
)
return
if
(
!
siteConfig
.
selector
)
return
count
++
docsAddon
.
visible
=
true
docsAddon
.
visible
=
true
clearTimeout
(
timer
)
}
timer
=
window
.
setTimeout
(()
=>
(
docsAddon
.
visible
=
false
),
180
)
function
onDragLeave
()
{
if
(
!
siteConfig
.
selector
)
return
count
--
if
(
count
<=
0
)
{
count
=
0
docsAddon
.
visible
=
false
}
}
}
async
function
onDrop
(
e
:
DragEvent
)
{
async
function
onDrop
(
e
:
DragEvent
)
{
...
@@ -115,7 +123,8 @@ function adjustPosition() {
...
@@ -115,7 +123,8 @@ function adjustPosition() {
onMounted
(()
=>
{
onMounted
(()
=>
{
const
doc
=
div
.
value
?.
ownerDocument
||
document
const
doc
=
div
.
value
?.
ownerDocument
||
document
doc
.
addEventListener
(
"dragover"
,
onDragOver
,
true
)
doc
.
addEventListener
(
"dragenter"
,
onDragEnter
,
true
)
doc
.
addEventListener
(
"dragleave"
,
onDragLeave
,
true
)
doc
.
defaultView
?.
addEventListener
(
"resize"
,
adjustPosition
)
doc
.
defaultView
?.
addEventListener
(
"resize"
,
adjustPosition
)
const
defaultChatDocSites
=
config
.
data
.
chatDocSites
const
defaultChatDocSites
=
config
.
data
.
chatDocSites
...
@@ -141,7 +150,8 @@ onMounted(() => {
...
@@ -141,7 +150,8 @@ onMounted(() => {
onUnmounted
(()
=>
{
onUnmounted
(()
=>
{
const
doc
=
div
.
value
?.
ownerDocument
||
document
const
doc
=
div
.
value
?.
ownerDocument
||
document
doc
.
removeEventListener
(
"dragover"
,
onDragOver
,
true
)
doc
.
removeEventListener
(
"dragenter"
,
onDragEnter
,
true
)
doc
.
removeEventListener
(
"dragleave"
,
onDragLeave
,
true
)
doc
.
removeEventListener
(
"resize"
,
adjustPosition
)
doc
.
removeEventListener
(
"resize"
,
adjustPosition
)
doc
.
defaultView
?.
removeEventListener
(
"resize"
,
adjustPosition
)
doc
.
defaultView
?.
removeEventListener
(
"resize"
,
adjustPosition
)
})
})
...
@@ -212,4 +222,3 @@ onUnmounted(() => {
...
@@ -212,4 +222,3 @@ onUnmounted(() => {
</
template
>
</
template
>
<
style
scoped
></
style
>
<
style
scoped
></
style
>
@/utils/const
src/components/chatdocs/ChatDocsPanel.vue
View file @
d3f55e2b
...
@@ -642,5 +642,4 @@ input:hover {
...
@@ -642,5 +642,4 @@ input:hover {
transform
:
translate
(
100%
,
0
);
transform
:
translate
(
100%
,
0
);
}
}
}
}
</
style
>
</
style
>
@/utils/const@/utils/invoke/service@/utils/invokeb
\ No newline at end of file
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