We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e49774 commit 98dd986Copy full SHA for 98dd986
src/rails.js
@@ -157,7 +157,11 @@
157
element.trigger('ajax:success', [data, status, xhr]);
158
},
159
complete: function(xhr, status) {
160
- element.trigger('ajax:complete', [xhr, status]);
+ if (element.parents('html').length > 0) {
161
+ element.trigger('ajax:complete', [xhr, status]);
162
+ } else {
163
+ $(document).trigger('ajax:complete', [xhr, status]);
164
+ }
165
166
error: function(xhr, status, error) {
167
element.trigger('ajax:error', [xhr, status, error]);
0 commit comments