Add a transition on panel closing (swipe close)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user