From 6bff38d1c2e52dd7e3d21455790c307ee41ed21b Mon Sep 17 00:00:00 2001 From: Matthew Harrison-Jones Date: Mon, 19 Aug 2013 16:13:47 +0100 Subject: [PATCH] Removed swiping from Mobile Interactions --- ghost/admin/mobile-interactions.js | 43 ++---------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/ghost/admin/mobile-interactions.js b/ghost/admin/mobile-interactions.js index e73cca6ef4..88cc8b7af2 100644 --- a/ghost/admin/mobile-interactions.js +++ b/ghost/admin/mobile-interactions.js @@ -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) {