vendor/assets/javascripts/hobo-jquery/hjq.js in hobo_jquery-2.0.0.pre1 vs vendor/assets/javascripts/hobo-jquery/hjq.js in hobo_jquery-2.0.0.pre2
- old
+ new
@@ -264,10 +264,14 @@
result.data["render["+i+"][id]"] = ids[i];
// default for render[i][function] is hjq.ajax.update
if(o.function) result.data["render["+i+"][function]"] = o['function'];
}
+ if(ids.length==0) {
+ result.data.render = 'none'
+ }
+
return result;
},
buildRequestCallbacks: function(result, o) {
var that = this;
@@ -278,11 +282,11 @@
var success_dfd = jQuery.Deferred();
if(o.attrs.success) success_dfd.done(methods.createFunction.call(that, o.attrs.success));
if(o.extra_callbacks.success) success_dfd.done(methods.createFunction.call(that, o.extra_callbacks.success));
success_dfd.done(function() {
- if(o.attrs.reset_form) that[0].reset();
+ if(o.attrs['reset-form']) that[0].reset();
// if we've been removed, all event handlers on us
// have already been removed and we don't bubble
// up, so triggering on that won't do any good
if(that.parents("body").length==0) $(document).trigger('rapid:ajax:success', [that]);
else that.trigger('rapid:ajax:success', [that]);
@@ -303,10 +307,10 @@
if(o.extra_callbacks.complete) complete_dfd.done(methods.createFunction.call(that, o.extra_callbacks.complete));
complete_dfd.done(function() {
if(that.parents("body").length==0) $(document).trigger('rapid:ajax:complete', [that]);
else that.trigger('rapid:ajax:complete', [that]);
spinner.hjq_spinner('remove');
- if(o.attrs.refocus_form) that.find(":input[type!=hidden]:first").focus();
+ if(o.attrs['refocus-form']) that.find(":input[type!=hidden]:first").focus();
});
result.complete = complete_dfd.resolve;
jQuery.extend(result, o.extra_options);