diff --git a/lib/persona.js b/lib/persona.js index 431776a..a1741ce 100644 --- a/lib/persona.js +++ b/lib/persona.js @@ -132,14 +132,18 @@ $(document).ready(function() { placement: 'left' }); - var dragging = false, originalY = 0; + var dragging = false, originalY = 0, toPage = page; handle.on('mousedown', function(ev) { dragging = true; originalY = ev.screenY; }); $('body').on('mouseup', function() { - dragging = false; + if (dragging === true) { + dragging = false; + ajaxify.go('topic/' + ajaxify.data.slug + '/' + (toPage * config.postsPerPage)); + } + //handle.css('margin-top', '0px'); }); @@ -149,8 +153,9 @@ $(document).ready(function() { } //handle.css('margin-top', (originalY - ev.screenY) + 'px'); - var distance = originalY - ev.screenY, - toPage = page - parseInt(distance / 50, 10); + var distance = originalY - ev.screenY; + + toPage = page - parseInt(distance / 50, 10); if (toPage > ajaxify.data.pageCount) { toPage = ajaxify.data.pageCount;