Browse Source

Change ajax timeout option to seconds instead of milliseconds

Thibaut 11 years ago
parent
commit
6c9441a76a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      assets/javascripts/lib/ajax.coffee

+ 2 - 2
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)