From 91c5e6be1394e8fa9acd8ace15da4944c318bac6 Mon Sep 17 00:00:00 2001 From: Jonathan Lipps Date: Thu, 18 Apr 2013 12:33:26 -0700 Subject: [PATCH] better defaults here --- app/controller.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controller.js b/app/controller.js index cb2cee080..93d5253c7 100644 --- a/app/controller.js +++ b/app/controller.js @@ -284,11 +284,12 @@ exports.mobileTap = function(req, res) { }; exports.mobileFlick = function(req, res) { - var onElement = typeof req.body.element !== "undefined"; req.body = _.defaults(req.body, { touchCount: 1 - , startX: onElement ? 0.5 : 'null' - , startY: onElement ? 0.5 : 'null' + , startX: 0.5 + , startY: 0.5 + , endX: 0.5 + , endY: 0.5 , element: null }); var touchCount = req.body.touchCount @@ -324,11 +325,12 @@ exports.find = function(req, res) { }; exports.mobileSwipe = function(req, res) { - var onElement = typeof req.body.element !== "undefined"; req.body = _.defaults(req.body, { touchCount: 1 - , startX: onElement ? 0.5 : 'null' - , startY: onElement ? 0.5 : 'null' + , startX: 0.5 + , startY: 0.5 + , endX: 0.5 + , endY: 0.5 , duration: 0.8 , element: null });