Add a transition on panel closing (swipe close)
This commit is contained in:
@@ -381,7 +381,7 @@ $.prototype.hoverSwap = function(sDefault, sHover)
|
||||
.text(sDefault);
|
||||
};
|
||||
|
||||
$.prototype.onSwipe = function(fOnEnd){
|
||||
$.prototype.onSwipe = function(fOnMove, fOnEnd){
|
||||
return $(this)
|
||||
.on('dragstart', (e) => {
|
||||
e.preventDefault();
|
||||
@@ -399,17 +399,25 @@ $.prototype.onSwipe = function(fOnEnd){
|
||||
var oPos = getDragPosition(e);
|
||||
$This.data('x-move', oPos.x);
|
||||
$This.data('y-move', oPos.y);
|
||||
fOnMove({
|
||||
xStart: $This.data('x-start'),
|
||||
yStart: $This.data('y-start'),
|
||||
xMove: $This.data('x-move'),
|
||||
yMove: $This.data('y-move')
|
||||
});
|
||||
}
|
||||
})
|
||||
.on('mouseup mouseleave touchend', (e) => {
|
||||
var $This = $(this);
|
||||
$This.data('moving', false).removeClass('moving');
|
||||
fOnEnd({
|
||||
xStart: $This.data('x-start'),
|
||||
yStart: $This.data('y-start'),
|
||||
xEnd: $This.data('x-move'),
|
||||
yEnd: $This.data('y-move')
|
||||
});
|
||||
if($This.data('moving')) {
|
||||
$This.data('moving', false).removeClass('moving');
|
||||
fOnEnd({
|
||||
xStart: $This.data('x-start'),
|
||||
yStart: $This.data('y-start'),
|
||||
xEnd: $This.data('x-move'),
|
||||
yEnd: $This.data('y-move')
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user