From 37a735c8eddcb8fb5a9d3fce30a70fecd01473ff Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Mon, 6 Feb 2017 10:36:57 -0600 Subject: [PATCH] Process JS API requests through the document Process JS API requests ($.request(handler, options)) through the document object instead of a non-existent form element. The form element was originally added because the framework only supported requests made from within a form ``` [22:08:12] spunky: The $triggerEl was implemented because previously it was just $form [22:08:24] spunky: For data-requests without a form, these events were being ignored [22:08:31] spunky: So as a workaround I implemented $triggerEl ``` As this is no longer the case, any JS API requests will now be made through the document element instead to support listening to events (such as ajaxSetup) even when there is no real attached element to trigger them on. --- modules/system/assets/js/framework.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/assets/js/framework.js b/modules/system/assets/js/framework.js index c673a73f4..7646a913a 100644 --- a/modules/system/assets/js/framework.js +++ b/modules/system/assets/js/framework.js @@ -387,7 +387,7 @@ if (window.jQuery.request !== undefined) { $.fn.request.Constructor = Request $.request = function(handler, option) { - return $('
').request(handler, option) + return $(document).request(handler, option) } // REQUEST NO CONFLICT