Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
open-source
gridstack.js
Commits
7ac8b2d8
Commit
7ac8b2d8
authored
Sep 11, 2017
by
radiolips
Committed by
GitHub
Sep 11, 2017
Browse files
Merge pull request #675 from vigor-vlad/trashzone_improvement
"trashzone" improvement
parents
4dd0a897
96355a94
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
src/gridstack.jQueryUI.js
src/gridstack.jQueryUI.js
+1
-7
src/gridstack.js
src/gridstack.js
+7
-4
No files found.
src/gridstack.jQueryUI.js
View file @
7ac8b2d8
...
...
@@ -77,13 +77,7 @@
JQueryUIGridStackDragDropPlugin
.
prototype
.
droppable
=
function
(
el
,
opts
)
{
el
=
$
(
el
);
if
(
opts
===
'
disable
'
||
opts
===
'
enable
'
)
{
el
.
droppable
(
opts
);
}
else
{
el
.
droppable
({
accept
:
opts
.
accept
});
}
return
this
;
};
...
...
src/gridstack.js
View file @
7ac8b2d8
...
...
@@ -623,6 +623,9 @@
disableResize
:
opts
.
disableResize
||
false
,
rtl
:
'
auto
'
,
removable
:
false
,
removableOptions
:
_
.
defaults
(
opts
.
removableOptions
||
{},
{
accept
:
'
.
'
+
opts
.
itemClass
}),
removeTimeout
:
2000
,
verticalMarginUnit
:
'
px
'
,
cellHeightUnit
:
'
px
'
,
...
...
@@ -770,9 +773,7 @@
if
(
!
self
.
opts
.
staticGrid
&&
typeof
self
.
opts
.
removable
===
'
string
'
)
{
var
trashZone
=
$
(
self
.
opts
.
removable
);
if
(
!
this
.
dd
.
isDroppable
(
trashZone
))
{
this
.
dd
.
droppable
(
trashZone
,
{
accept
:
'
.
'
+
self
.
opts
.
itemClass
});
this
.
dd
.
droppable
(
trashZone
,
self
.
opts
.
removableOptions
);
}
this
.
dd
.
on
(
trashZone
,
'
dropover
'
,
function
(
event
,
ui
)
{
...
...
@@ -781,6 +782,7 @@
if
(
node
.
_grid
!==
self
)
{
return
;
}
el
.
data
(
'
inTrashZone
'
,
true
);
self
.
_setupRemovingTimeout
(
el
);
})
.
on
(
trashZone
,
'
dropout
'
,
function
(
event
,
ui
)
{
...
...
@@ -789,6 +791,7 @@
if
(
node
.
_grid
!==
self
)
{
return
;
}
el
.
data
(
'
inTrashZone
'
,
false
);
self
.
_clearRemovingTimeout
(
el
);
});
}
...
...
@@ -1097,7 +1100,7 @@
}
if
(
event
.
type
==
'
drag
'
)
{
if
(
x
<
0
||
x
>=
self
.
grid
.
width
||
y
<
0
||
(
!
self
.
grid
.
float
&&
y
>
self
.
grid
.
getGridHeight
()))
{
if
(
el
.
data
(
'
inTrashZone
'
)
||
x
<
0
||
x
>=
self
.
grid
.
width
||
y
<
0
||
(
!
self
.
grid
.
float
&&
y
>
self
.
grid
.
getGridHeight
()))
{
if
(
!
node
.
_temporaryRemoved
)
{
if
(
self
.
opts
.
removable
===
true
)
{
self
.
_setupRemovingTimeout
(
el
);
...
...
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