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
277c2ec9
Commit
277c2ec9
authored
1 year ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Reformat
parent
6819157a
No related branches found
No related tags found
1 merge request
!12
Pass dragging information to slot for disabled fields
Pipeline
#142931
passed
1 year ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
example/index.html
+1
-1
1 addition, 1 deletion
example/index.html
example/src/Example5Colors.vue
+3
-3
3 additions, 3 deletions
example/src/Example5Colors.vue
src/DragGrid.vue
+6
-6
6 additions, 6 deletions
src/DragGrid.vue
with
10 additions
and
10 deletions
example/index.html
+
1
−
1
View file @
277c2ec9
<!
DOCTYPE
html>
<!
doctype
html>
<html
lang=
"en"
>
<html
lang=
"en"
>
<head>
<head>
<meta
charset=
"UTF-8"
/>
<meta
charset=
"UTF-8"
/>
...
...
This diff is collapsed.
Click to expand it.
example/src/Example5Colors.vue
+
3
−
3
View file @
277c2ec9
...
@@ -91,7 +91,7 @@ export default {
...
@@ -91,7 +91,7 @@ export default {
// Moved to gridA
// Moved to gridA
this
.
findAndRemove
(
this
.
findAndRemove
(
item
.
originGridId
===
"
gridB
"
?
this
.
placedB
:
this
.
placedC
,
item
.
originGridId
===
"
gridB
"
?
this
.
placedB
:
this
.
placedC
,
item
.
key
item
.
key
,
);
);
this
.
placedA
.
push
(
item
.
key
);
this
.
placedA
.
push
(
item
.
key
);
break
;
break
;
...
@@ -99,7 +99,7 @@ export default {
...
@@ -99,7 +99,7 @@ export default {
// Moved to gridB
// Moved to gridB
this
.
findAndRemove
(
this
.
findAndRemove
(
item
.
originGridId
===
"
gridA
"
?
this
.
placedA
:
this
.
placedC
,
item
.
originGridId
===
"
gridA
"
?
this
.
placedA
:
this
.
placedC
,
item
.
key
item
.
key
,
);
);
this
.
placedB
.
push
(
item
.
key
);
this
.
placedB
.
push
(
item
.
key
);
break
;
break
;
...
@@ -107,7 +107,7 @@ export default {
...
@@ -107,7 +107,7 @@ export default {
// Moved to gridC
// Moved to gridC
this
.
findAndRemove
(
this
.
findAndRemove
(
item
.
originGridId
===
"
gridB
"
?
this
.
placedB
:
this
.
placedA
,
item
.
originGridId
===
"
gridB
"
?
this
.
placedB
:
this
.
placedA
,
item
.
key
item
.
key
,
);
);
this
.
placedC
.
push
(
item
.
key
);
this
.
placedC
.
push
(
item
.
key
);
break
;
break
;
...
...
This diff is collapsed.
Click to expand it.
src/DragGrid.vue
+
6
−
6
View file @
277c2ec9
...
@@ -179,7 +179,7 @@ export default {
...
@@ -179,7 +179,7 @@ export default {
let
element
=
JSON
.
parse
(
data
);
let
element
=
JSON
.
parse
(
data
);
let
coords
=
this
.
getCoords
(
let
coords
=
this
.
getCoords
(
event
.
dragEvent
.
client
.
x
-
element
.
mouseX
,
event
.
dragEvent
.
client
.
x
-
element
.
mouseX
,
event
.
dragEvent
.
client
.
y
-
element
.
mouseY
event
.
dragEvent
.
client
.
y
-
element
.
mouseY
,
);
);
if
(
element
.
context
!==
this
.
context
||
this
.
noHighlight
)
{
if
(
element
.
context
!==
this
.
context
||
this
.
noHighlight
)
{
...
@@ -225,7 +225,7 @@ export default {
...
@@ -225,7 +225,7 @@ export default {
let
coords
=
this
.
getCoords
(
let
coords
=
this
.
getCoords
(
event
.
dragEvent
.
client
.
x
-
element
.
mouseX
,
event
.
dragEvent
.
client
.
x
-
element
.
mouseX
,
event
.
dragEvent
.
client
.
y
-
element
.
mouseY
event
.
dragEvent
.
client
.
y
-
element
.
mouseY
,
);
);
let
newPositionValid
=
true
;
let
newPositionValid
=
true
;
...
@@ -264,7 +264,7 @@ export default {
...
@@ -264,7 +264,7 @@ export default {
if
(
e
.
code
===
DOMException
.
DATA_CLONE_ERR
)
{
if
(
e
.
code
===
DOMException
.
DATA_CLONE_ERR
)
{
// We use functions for properties → we can't clone; only emit `item-changed` event
// We use functions for properties → we can't clone; only emit `item-changed` event
console
.
debug
(
console
.
debug
(
"
Grid couldn't be cloned, please listen to the `item-changed` event and handle changes yourself.
"
"
Grid couldn't be cloned, please listen to the `item-changed` event and handle changes yourself.
"
,
);
);
}
else
{
}
else
{
throw
e
;
throw
e
;
...
@@ -286,12 +286,12 @@ export default {
...
@@ -286,12 +286,12 @@ export default {
x
:
this
.
clamp
(
x
:
this
.
clamp
(
1
,
1
,
Math
.
ceil
((
x
-
rect
.
x
)
/
(
rect
.
width
/
this
.
cols
)),
Math
.
ceil
((
x
-
rect
.
x
)
/
(
rect
.
width
/
this
.
cols
)),
this
.
cols
this
.
cols
,
),
),
y
:
this
.
clamp
(
y
:
this
.
clamp
(
1
,
1
,
Math
.
ceil
((
y
-
rect
.
y
)
/
(
rect
.
height
/
this
.
rows
)),
Math
.
ceil
((
y
-
rect
.
y
)
/
(
rect
.
height
/
this
.
rows
)),
this
.
rows
this
.
rows
,
),
),
};
};
},
},
...
@@ -326,7 +326,7 @@ export default {
...
@@ -326,7 +326,7 @@ export default {
if
(
this
.
value
.
some
((
item
)
=>
item
.
w
>
1
))
{
if
(
this
.
value
.
some
((
item
)
=>
item
.
w
>
1
))
{
console
.
warn
(
console
.
warn
(
"
You are using multipleItemsY but some items have a width greater than 1.
"
,
"
You are using multipleItemsY but some items have a width greater than 1.
"
,
"
This is not supported and will lead to unexpected behaviour.
"
"
This is not supported and will lead to unexpected behaviour.
"
,
);
);
}
}
...
...
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