Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vue-draggable-grid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Libraries
vue-draggable-grid
Commits
cfa0806f
Commit
cfa0806f
authored
1 year ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Change zIndex of dragged item to be the biggest
parent
802e1247
No related branches found
No related tags found
1 merge request
!10
Change zIndex of dragged item to be the biggest
Pipeline
#138837
failed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/DragContainer.vue
+5
-0
5 additions, 0 deletions
src/DragContainer.vue
with
5 additions
and
0 deletions
src/DragContainer.vue
+
5
−
0
View file @
cfa0806f
...
@@ -31,10 +31,13 @@ export default {
...
@@ -31,10 +31,13 @@ export default {
mouseX
:
event
.
clientX
-
rect
.
x
-
rect
.
width
/
(
2
*
this
.
w
),
// relative to center of the top left square
mouseX
:
event
.
clientX
-
rect
.
x
-
rect
.
width
/
(
2
*
this
.
w
),
// relative to center of the top left square
mouseY
:
event
.
clientY
-
rect
.
y
-
rect
.
height
/
(
2
*
this
.
h
),
mouseY
:
event
.
clientY
-
rect
.
y
-
rect
.
height
/
(
2
*
this
.
h
),
};
};
// Now the element is on top of everything else inside the grid (not on top of other grids though)
this
.
zIndex
=
999999
;
},
},
handleDragEnd
()
{
handleDragEnd
()
{
this
.
offsetX
=
0
;
this
.
offsetX
=
0
;
this
.
offsetY
=
0
;
this
.
offsetY
=
0
;
this
.
zIndex
=
"
auto
"
;
},
},
handleDragMove
(
event
)
{
handleDragMove
(
event
)
{
this
.
offsetX
+=
event
.
dx
;
this
.
offsetX
+=
event
.
dx
;
...
@@ -108,6 +111,7 @@ export default {
...
@@ -108,6 +111,7 @@ export default {
dataTransfer
:
{},
dataTransfer
:
{},
offsetX
:
0
,
offsetX
:
0
,
offsetY
:
0
,
offsetY
:
0
,
zIndex
:
"
auto
"
,
};
};
},
},
};
};
...
@@ -123,5 +127,6 @@ export default {
...
@@ -123,5 +127,6 @@ export default {
calc
(
1px
*
v-bind
(
offsetX
)),
calc
(
1px
*
v-bind
(
offsetX
)),
calc
(
1px
*
v-bind
(
offsetY
))
calc
(
1px
*
v-bind
(
offsetY
))
);
);
z-index
:
v-bind
(
zIndex
);
}
}
</
style
>
</
style
>
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