MoveTo now moves to the center if no offset is provided

This commit is contained in:
Dan Cuellar
2013-09-07 12:33:42 -07:00
parent 21af9b5777
commit dde95315a9

View File

@@ -647,9 +647,14 @@ exports.getScreenshot = function(req, res) {
};
exports.moveTo = function(req, res) {
req.body = _.defaults(req.body, {
xoffset: 0.5
, yoffset: 0.5
});
var xoffset = req.body.xoffset
, yoffset = req.body.yoffset
, element = req.body.element;
req.device.moveTo(element, xoffset, yoffset, getResponseHandler(req, res));
};