From 6c9441a76a242a5b7f1e6cf1f5fca22d971215f2 Mon Sep 17 00:00:00 2001 From: Thibaut Date: Tue, 13 Jan 2015 21:06:09 -0500 Subject: [PATCH] Change ajax timeout option to seconds instead of milliseconds --- assets/javascripts/lib/ajax.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/lib/ajax.coffee b/assets/javascripts/lib/ajax.coffee index 62f3d276..6433de0d 100644 --- a/assets/javascripts/lib/ajax.coffee +++ b/assets/javascripts/lib/ajax.coffee @@ -22,7 +22,7 @@ MIME_TYPES = ajax.defaults = async: true dataType: 'json' - timeout: 30000 + timeout: 30 type: 'GET' # contentType # context @@ -53,7 +53,7 @@ serializeParams = (params) -> applyCallbacks = (xhr, options) -> return unless options.async - xhr.timer = setTimeout onTimeout.bind(undefined, xhr, options), options.timeout + xhr.timer = setTimeout onTimeout.bind(undefined, xhr, options), options.timeout * 1000 xhr.onreadystatechange = -> if xhr.readyState is 4 clearTimeout(xhr.timer)