Skip to content

Commit

Permalink
Set default speed limit to selectajax - refs BT#18201
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Apr 19, 2021
1 parent 2293021 commit aedeeca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions main/inc/lib/formvalidator/Element/SelectAjax.php
Expand Up @@ -76,8 +76,7 @@ public function toHtml()
$max = !empty($max) ? "maximumSelectionLength: $max, " : '';

// wait XX milliseconds before triggering the request
$delay = (int) $this->getAttribute('delay');
$delay = (0 !== $delay) ? "delay: $delay, " : '';
$delay = ((int) $this->getAttribute('delay')) ?: 1000;

$html = <<<JS
<script>
Expand All @@ -91,7 +90,7 @@ public function toHtml()
tags: $tags,
ajax: {
url: $url,
{$delay}
delay: $delay,
dataType: 'json',
data: function(params) {
return {
Expand Down
1 change: 0 additions & 1 deletion main/messages/new_message.php
Expand Up @@ -180,7 +180,6 @@ function manageForm($default, $select_from_user_list = null, $sent_to = '', $tpl
[],
[
'multiple' => 'multiple',
'delay' => 1000,
'url' => api_get_path(WEB_AJAX_PATH).'message.ajax.php?a=find_users',
]
);
Expand Down

1 comment on commit aedeeca

@AngelFQC
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The delay property was added in this PR #3368 as option

Please sign in to comment.