Skip to content
Snippets Groups Projects
Commit ddd149d9 authored by Moritz Strohm's avatar Moritz Strohm Committed by Elmar Ludwig
Browse files

QuickSearch: only send necessary data to trigger the search, fixes #3381

Closes #3381

Merge request studip/studip!2301
parent 8fd260dc
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
<div class="message-search-wrapper"> <div class="message-search-wrapper">
<?= QuickSearch::get('user_id', new StandardSearch('user_id')) <?= QuickSearch::get('user_id', new StandardSearch('user_id'))
->fireJSFunctionOnSelect('STUDIP.Messages.add_adressee') ->fireJSFunctionOnSelect('STUDIP.Messages.add_adressee')
->setAttributes(['data-context' => ''])
->withButton() ->withButton()
->render(); ->render();
......
...@@ -43,9 +43,12 @@ const QuickSearch = { ...@@ -43,9 +43,12 @@ const QuickSearch = {
}, },
source: function(input, add) { source: function(input, add) {
//get the variables that should be sent: //get the variables that should be sent:
var send_vars = jQuery('#' + name) let node = jQuery('#' + name);
.closest('form') let form = jQuery(node[0].form);
.serializeArray(); if (node.data('context') !== undefined) {
form = form.find(node.data('context'))
}
let send_vars = form.serializeArray();
send_vars.push({ send_vars.push({
name: 'request', name: 'request',
value: input.term value: input.term
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment