allow ajax data parameter to be specified as a function

(test updated by arshaw after-the-fact)
This commit is contained in:
Paul Gallagher
2013-07-29 23:14:37 -07:00
committed by Adam Shaw
parent 155b78cc1a
commit c93f64fc8b
2 changed files with 61 additions and 1 deletions
+7 -1
View File
@@ -136,7 +136,13 @@ function EventManager(options, _sources) {
var success = source.success;
var error = source.error;
var complete = source.complete;
var data = $.extend({}, source.data || {});
var custom_data;
if ($.isFunction(source.data)) {
custom_data = source.data();
} else {
custom_data = source.data;
}
var data = $.extend({}, custom_data || {});
var startParam = firstDefined(source.startParam, options.startParam);
var endParam = firstDefined(source.endParam, options.endParam);
if (startParam) {