Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TIPM-UI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOUDNI Samir
TIPM-UI
Commits
9951ed62
Verified
Commit
9951ed62
authored
2 years ago
by
BARBIER Marc
Browse files
Options
Downloads
Patches
Plain Diff
Patch de l'afficage du drag and drop
parent
256fb7f8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ImageMiningView/ImageMiningView.ts
+13
-10
13 additions, 10 deletions
src/ImageMiningView/ImageMiningView.ts
src/ImageMiningView/ImageMiningView.vue
+1
-1
1 addition, 1 deletion
src/ImageMiningView/ImageMiningView.vue
with
14 additions
and
11 deletions
src/ImageMiningView/ImageMiningView.ts
+
13
−
10
View file @
9951ed62
...
...
@@ -62,7 +62,7 @@ export default defineComponent({
const
fileIds
:
number
[]
=
await
response
.
json
()
for
(
const
fileId
of
fileIds
)
{
const
response
=
await
secureFetch
(
this
,
import
.
meta
.
env
.
VITE_BACKEND_URL
+
'
/image/${fileId}
'
)
const
response
=
await
secureFetch
(
this
,
import
.
meta
.
env
.
VITE_BACKEND_URL
+
`
/image/
${
fileId
}
`
)
const
contentDisposition
=
response
.
headers
.
get
(
"
Content-Disposition
"
)
if
(
!
contentDisposition
)
{
console
.
log
(
"
warning: incomplete filename
"
)
...
...
@@ -81,7 +81,7 @@ export default defineComponent({
let
original
:
HTMLDivElement
|
HTMLParagraphElement
=
this
.
currentDrag
.
target
if
(
original
.
nodeName
!==
'
DIV
'
)
{
//@ts-expect-error P's parent is a div
original
=
original
.
parent
original
=
original
.
parent
Node
}
original
.
style
.
opacity
=
'
1
'
...
...
@@ -90,8 +90,7 @@ export default defineComponent({
//@ts-expect-error Target is generic
let
newTargetParagraph
:
HTMLParagraphElement
|
HTMLDivElement
|
HTMLInputElement
=
e
.
target
if
(
newTargetParagraph
.
nodeName
!==
'
DIV
'
)
{
//@ts-expect-error parent cannot be div
newTargetParagraph
=
newTargetParagraph
.
parent
as
HTMLDivElement
newTargetParagraph
=
newTargetParagraph
.
parentNode
as
HTMLDivElement
}
if
(
!
newTargetParagraph
)
return
const
newInput
=
newTargetParagraph
.
querySelector
(
'
input
'
)
as
HTMLInputElement
...
...
@@ -118,28 +117,32 @@ export default defineComponent({
},
enter
(
e
:
Event
)
{
e
.
preventDefault
()
//@ts-expect-error target is generic
let
target
:
HTMLDivElement
|
HTMLParagraphElement
|
null
=
e
.
target
if
(
!
target
)
return
if
(
target
.
nodeName
=
==
'
P
'
)
{
if
(
target
.
nodeName
!
==
'
DIV
'
)
{
//@ts-expect-error P's parent is a div
target
=
target
.
parent
target
=
target
.
parent
Node
if
(
!
target
)
return
}
target
.
style
.
marginLeft
=
"
40px
"
e
.
preventDefault
()
if
(
this
.
currentDrag
.
target
===
target
)
return
target
.
style
.
marginLeft
=
'
40px
'
},
exit
(
e
:
Event
)
{
//@ts-expect-error target is generic
let
target
:
HTMLDivElement
|
HTMLParagraphElement
|
null
=
e
.
target
if
(
!
target
)
return
if
(
target
.
nodeName
=
==
'
P
'
)
{
if
(
target
.
nodeName
!
==
'
DIV
'
)
{
//@ts-expect-error P's parent is a div
target
=
target
.
parent
target
=
target
.
parent
Node
if
(
!
target
)
return
}
if
(
this
.
currentDrag
.
target
===
target
)
return
target
.
style
.
marginLeft
=
"
auto
"
e
.
preventDefault
()
},
...
...
This diff is collapsed.
Click to expand it.
src/ImageMiningView/ImageMiningView.vue
+
1
−
1
View file @
9951ed62
...
...
@@ -18,7 +18,7 @@
@
dragexit=
"exit"
>
<img
:src=
"file.src"
class=
"fullscreenimg"
@
dragstart=
"() => false"
@
dragstart=
"(
e
) =>
{ e.preventDefault(); return
false
}
"
@mouseover="currentOver = file.id"
@mouseleave="currentOver = null"
alt=""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment