Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ The following events are triggered when AJAX modals are requested.
$.modal.AJAX_FAIL = 'modal:ajax:fail';
$.modal.AJAX_COMPLETE = 'modal:ajax:complete';

The handlers receive no arguments. The events are triggered on the `<a>` element which initiated the AJAX modal.
The handlers receive the same arguments as the jQuery `jqXHR.done()` and `jqXHR.fail()` promise methods. The events are triggered on the `<a>` element which initiated the AJAX modal.

## More advanced AJAX handling

Expand Down
4 changes: 2 additions & 2 deletions jquery.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
el.trigger($.modal.AJAX_SEND);
$.get(target).done(function(html) {
if (!current) return;
el.trigger($.modal.AJAX_SUCCESS);
el.trigger($.modal.AJAX_SUCCESS,arguments);
current.$elm.empty().append(html).on($.modal.CLOSE, remove);
current.hideSpinner();
current.open();
el.trigger($.modal.AJAX_COMPLETE);
}).fail(function() {
el.trigger($.modal.AJAX_FAIL);
el.trigger($.modal.AJAX_FAIL,arguments);
current.hideSpinner();
el.trigger($.modal.AJAX_COMPLETE);
});
Expand Down