Use the same options object in handle-response as in send-request
Instead of cloning this.options again in handle-response.js, pass the options object from send-request.js. This way, pjax.state.options will also have the request options.
This commit is contained in:
@@ -13,21 +13,21 @@ module.exports = function(location, options, callback) {
|
||||
request.onreadystatechange = function() {
|
||||
if (request.readyState === 4) {
|
||||
if (request.status === 200) {
|
||||
callback(request.responseText, request, location)
|
||||
callback(request.responseText, request, location, options)
|
||||
}
|
||||
else if (request.status !== 0) {
|
||||
callback(null, request, location)
|
||||
callback(null, request, location, options)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
request.onerror = function(e) {
|
||||
console.log(e)
|
||||
callback(null, request, location)
|
||||
callback(null, request, location, options)
|
||||
}
|
||||
|
||||
request.ontimeout = function() {
|
||||
callback(null, request, location)
|
||||
callback(null, request, location, options)
|
||||
}
|
||||
|
||||
// Prepare the request payload for forms, if available
|
||||
|
||||
Reference in New Issue
Block a user