From ae4b6339bcdc8ef635b54b6101722d7f8326ee06 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Mon, 20 Jul 2015 17:34:24 -0400 Subject: [PATCH] moved dragging to X axis --- lib/persona.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/persona.js b/lib/persona.js index a1741ce..f0048f1 100644 --- a/lib/persona.js +++ b/lib/persona.js @@ -132,10 +132,10 @@ $(document).ready(function() { placement: 'left' }); - var dragging = false, originalY = 0, toPage = page; + var dragging = false, originalX = 0, toPage = page; handle.on('mousedown', function(ev) { dragging = true; - originalY = ev.screenY; + originalX = ev.screenX; }); $('body').on('mouseup', function() { @@ -143,8 +143,6 @@ $(document).ready(function() { dragging = false; ajaxify.go('topic/' + ajaxify.data.slug + '/' + (toPage * config.postsPerPage)); } - - //handle.css('margin-top', '0px'); }); $('body').on('mousemove', function(ev) { @@ -152,8 +150,7 @@ $(document).ready(function() { return; } - //handle.css('margin-top', (originalY - ev.screenY) + 'px'); - var distance = originalY - ev.screenY; + var distance = originalX - ev.screenX; toPage = page - parseInt(distance / 50, 10);