From 7161642224b4dd468477fb8a23c293e0821b70f3 Mon Sep 17 00:00:00 2001 From: Jeena Date: Tue, 3 Jun 2014 22:55:32 +0200 Subject: [PATCH] easier swiping --- js/App.js | 9 ++++++--- js/hammer.js | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/js/App.js b/js/App.js index c81fc13..73c4257 100644 --- a/js/App.js +++ b/js/App.js @@ -96,8 +96,10 @@ App.prototype.after_login = function(backend) { dragBlockHorizontal: true }; var hammertime = new Hammer($("#full"), options); - hammertime.on("dragleft swipeleft", function(ev){ ev.gesture.preventDefault(); _this.showNext() }); - hammertime.on("dragright swiperight", function(ev){ ev.gesture.preventDefault(); _this.showPrevious(); }); + hammertime.on("dragleft", function(ev){ ev.gesture.preventDefault(); }); + hammertime.on("dragright", function(ev){ ev.gesture.preventDefault(); }); + hammertime.on("swipeleft", function(ev){ _this.showNext(); ev.gesture.preventDefault(); }); + hammertime.on("swiperight", function(ev){ _this.showPrevious(); ev.gesture.preventDefault(); }); this.changeToPage("#list"); @@ -176,7 +178,6 @@ App.prototype.gotUnreadFeeds = function(new_articles) { try { //To check if when it fails it is the same localStorage.unread_articles = JSON.stringify(this.unread_articles); - //alert("Size probando:"+probando.length) var size = parseInt(localStorage.maxDownload); if(localStorage.unread_articles.length < size) { var num = parseInt(localStorage.numArticles); @@ -316,6 +317,8 @@ App.prototype.showFull = function(article, slide_back) { $(page_id + " .author").innerHTML = "– " + article.author; $(page_id + " .article").innerHTML = article.content; + + // Open all links in browser $$(page_id + " .article a").forEach(function(o, i) { o.target = "_blank"; }); diff --git a/js/hammer.js b/js/hammer.js index e03acdc..703ee55 100644 --- a/js/hammer.js +++ b/js/hammer.js @@ -1825,7 +1825,7 @@ Hammer.gestures.Swipe = { * @type {Number} * @default 0.6 */ - swipeVelocityX: 0.6, + swipeVelocityX: 0.2, /** * vertical swipe velocity @@ -1833,7 +1833,7 @@ Hammer.gestures.Swipe = { * @type {Number} * @default 0.6 */ - swipeVelocityY: 0.6 + swipeVelocityY: 0.2 }, handler: function swipeGesture(ev, inst) {