mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: rewriting overridden ajax success handler to work with new ajax function in jQuery 1.5
This commit is contained in:
parent
52070a0c3a
commit
9727d2e6f9
@ -149,13 +149,15 @@
|
||||
var _dataType = s.dataType;
|
||||
|
||||
// This replaces the usual ajax success & complete handlers. They are called after any on demand JS is loaded.
|
||||
var _ondemandComplete = function(xml, status) {
|
||||
var status = $.httpSuccess(xml) ? 'success' : 'error';
|
||||
var _ondemandComplete = function(data, status) {
|
||||
//var status = $.httpSuccess(xml) ? 'success' : 'error'; //rewrote success function as httpSuccess doesn't exist anymore in jQuery 1.5
|
||||
if (typeof status == 'undefined' || status != 'success') status = 'error';
|
||||
|
||||
if(status == 'success') {
|
||||
var data = jQuery.httpData(xml, _dataType);
|
||||
//var data = jQuery.httpData(xml, _dataType); //unnecessary as data type conversion is automatically done in jQuery 1.5 using the ajaxConvert method
|
||||
if(_success) _success(data, status);
|
||||
}
|
||||
if(_complete) _complete(xml, status);
|
||||
if(_complete) _complete(data, status);
|
||||
}
|
||||
|
||||
// We remove the success handler and take care of calling it outselves within _ondemandComplete
|
||||
|
Loading…
Reference in New Issue
Block a user