mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Specify explicit form element
This allows request elements external to the form to serialize a target form for use. An example might be a search form at the top of a page, list of results in the middle, then the pagination at the bottom. The pagination would need to target the search form with data-request-form to persist the search query value. This should work with the JS API too, passed as an object, because $($()) is acceptable in jQuery
This commit is contained in:
parent
6697e00649
commit
b6fedfb688
@ -32,7 +32,7 @@ if (window.jQuery.request !== undefined) {
|
||||
/*
|
||||
* Prepare the options and execute the request
|
||||
*/
|
||||
var $form = $el.closest('form'),
|
||||
var $form = options.form ? $(options.form) : $el.closest('form'),
|
||||
$triggerEl = !!$form.length ? $form : $el,
|
||||
context = { handler: handler, options: options }
|
||||
|
||||
@ -377,6 +377,7 @@ if (window.jQuery.request !== undefined) {
|
||||
redirect: $this.data('request-redirect'),
|
||||
loading: $this.data('request-loading'),
|
||||
flash: $this.data('request-flash'),
|
||||
form: $this.data('request-form'),
|
||||
update: paramToObj('data-request-update', $this.data('request-update')),
|
||||
data: paramToObj('data-request-data', $this.data('request-data'))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user