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 @@
<div class="message-search-wrapper">
<?= QuickSearch::get('user_id', new StandardSearch('user_id'))
->fireJSFunctionOnSelect('STUDIP.Messages.add_adressee')
->setAttributes(['data-context' => ''])
->withButton()
->render();
......
......@@ -43,9 +43,12 @@ const QuickSearch = {
},
source: function(input, add) {
//get the variables that should be sent:
var send_vars = jQuery('#' + name)
.closest('form')
.serializeArray();
let node = jQuery('#' + name);
let form = jQuery(node[0].form);
if (node.data('context') !== undefined) {
form = form.find(node.data('context'))
}
let send_vars = form.serializeArray();
send_vars.push({
name: 'request',
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