Permalink
Browse files

fixed #14 synchronous ajax calls did not return a value (thanks to mi…

…kisvaz)
  • Loading branch information...
1 parent 58b6b7d commit 1feef877ca1066dca682c4ae6694063366e24cf8 @langalex langalex committed Dec 27, 2009
Showing with 9 additions and 5 deletions.
  1. +9 −5 rails_generators/culerity/templates/public/javascripts/culerity.js
@@ -12,15 +12,19 @@ jQuery(function($) {
throw(e);
}
window.running_ajax_calls -= 1;
- }
+ };
};
window.running_ajax_calls = 0;
var ajax_with_count = function(options) {
- window.running_ajax_calls += 1;
- options.success = count_down(options.success);
- options.error = count_down(options.error);
- original_ajax(options);
+ if(options.async == false) {
+ return(original_ajax(options));
+ } else {
+ window.running_ajax_calls += 1;
+ options.success = count_down(options.success);
+ options.error = count_down(options.error);
+ return original_ajax(options);
+ }
};
$.ajax = ajax_with_count;

0 comments on commit 1feef87

Please sign in to comment.