Add a transition on panel closing (swipe close)

This commit is contained in:
2022-09-27 17:23:21 +02:00
parent 303f903120
commit 559188413e
5 changed files with 39 additions and 13 deletions

View File

@@ -207,8 +207,24 @@ function initPage(asHash) {
getPost({type: 'loading', headerless: true, formatted_time: '', relative_time: ''}).appendTo($('#loading'));
//Mobile events
self.tmp('$Feed').onSwipe((oPos) => {if(oPos.xEnd - oPos.xStart > 100 && Math.abs(oPos.yEnd - oPos.yStart) < 100) toggleFeedPanel(false);});
self.tmp('$Settings').onSwipe((oPos) => {if(oPos.xEnd - oPos.xStart < -100 && Math.abs(oPos.yEnd - oPos.yStart) < 100) toggleSettingsPanel(false);});
self.tmp('$Feed').onSwipe(
(oPos) => {
self.tmp('$Feed').css('right', Math.min(oPos.xStart - oPos.xMove, 0)+'px');
},
(oPos) => {
if(oPos.xEnd - oPos.xStart > 100 && Math.abs(oPos.yEnd - oPos.yStart) < 100) toggleFeedPanel(false);
self.tmp('$Feed').css('right', '');
}
);
self.tmp('$Settings').onSwipe(
(oPos) => {
self.tmp('$Settings').css('left', Math.min(oPos.xMove - oPos.xStart, 0)+'px');
},
(oPos) => {
if(oPos.xEnd - oPos.xStart < -100 && Math.abs(oPos.yEnd - oPos.yStart) < 100) toggleSettingsPanel(false);
self.tmp('$Settings').css('left', '');
}
);
//Feed Panel
initPosts();
@@ -933,7 +949,7 @@ function getPost(asPost) {
},
function(){
var oMarker = oSpot.tmp(['markers', $(this).data('id')]);
if(oMarker.isPopupOpen() && !$(this).data('clicked')) oMarker.closePopup();
if(oMarker && oMarker.isPopupOpen() && !$(this).data('clicked')) oMarker.closePopup();
$(this).data('clicked', false);
}
);