mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Merge pull request #457 from matthojo/Mobile-Interactions
Removed swiping from Mobile Interactions
This commit is contained in:
commit
b0430d98d3
@ -12,26 +12,8 @@
|
||||
// `drag: false` Removes the Hammer drag event listeners, as they were clashing with jQueryUI Draggable
|
||||
var Hammer = $(document).hammer({stop_browser_behavior: { touchAction: true }, drag: false});
|
||||
|
||||
// ### Show left menu sidebar on right swipe
|
||||
Hammer.on("swiperight", "#global-header", function (event) {
|
||||
if (window.matchMedia('(max-width: 650px)').matches) {
|
||||
event.gesture.preventDefault();
|
||||
event.stopPropagation();
|
||||
$('body').addClass('off-canvas');
|
||||
}
|
||||
});
|
||||
|
||||
// ### Hide left menu sidebar on swipe left
|
||||
Hammer.on("swipeleft", "#main-menu", function (event) {
|
||||
if (window.matchMedia('(max-width: 650px)').matches) {
|
||||
event.gesture.preventDefault();
|
||||
event.stopPropagation();
|
||||
$('body').removeClass('off-canvas');
|
||||
}
|
||||
});
|
||||
|
||||
// ### Show content preview when swiping left on content list
|
||||
Hammer.on("tap swipeleft", ".manage .content-list ol li", function (event) {
|
||||
Hammer.on("tap", ".manage .content-list ol li", function (event) {
|
||||
if (window.matchMedia('(max-width: 800px)').matches) {
|
||||
event.gesture.preventDefault();
|
||||
event.stopPropagation();
|
||||
@ -40,19 +22,8 @@
|
||||
}
|
||||
});
|
||||
|
||||
// ### Show content list when swiping right on preview
|
||||
Hammer.on("swiperight", ".content-preview", function (event) {
|
||||
if (window.matchMedia('(max-width: 800px)').matches) {
|
||||
event.gesture.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
$(".content-list").animate({right: "0", left: "0", 'margin-right': "0"}, 300);
|
||||
$(".content-preview").animate({right: "-100%", left: "100%", 'margin-left': "15px"}, 300);
|
||||
}
|
||||
});
|
||||
|
||||
// ### Show settings options page when swiping left on settings menu link
|
||||
Hammer.on("tap swipeleft", ".settings .settings-menu li", function (event) {
|
||||
Hammer.on("tap", ".settings .settings-menu li", function (event) {
|
||||
if (window.matchMedia('(max-width: 800px)').matches) {
|
||||
event.gesture.preventDefault();
|
||||
event.stopPropagation();
|
||||
@ -61,16 +32,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
// ### Show settings menu when swiping right on settings options page
|
||||
Hammer.on("swiperight", ".settings-content", function (event) {
|
||||
if (window.matchMedia('(max-width: 800px)').matches) {
|
||||
event.gesture.preventDefault();
|
||||
event.stopPropagation();
|
||||
$(".settings-sidebar").animate({right: "0", left: "0", 'margin-right': "0"}, 300);
|
||||
$(".settings-content").animate({right: "-100%", left: "100%", 'margin-left': "15px"}, 300);
|
||||
}
|
||||
});
|
||||
|
||||
// ### Toggle the sidebar menu
|
||||
$('[data-off-canvas]').on('click', function (e) {
|
||||
if (window.matchMedia('(max-width: 650px)').matches) {
|
||||
|
Loading…
Reference in New Issue
Block a user