1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-14 18:55:56 +02:00

Update InputfieldPageAutocomplete.js to initialize the autocomplete on focus event, rather than on document ready. This resolves a render time issue in AdminThemeUikit when there are a lot of autocomplete inputs present, per @Toutouwai

This commit is contained in:
Ryan Cramer
2018-05-08 09:25:07 -04:00
parent 2f20fe402c
commit e520c09f7a
5 changed files with 137 additions and 133 deletions

View File

@@ -98,6 +98,7 @@ var InputfieldPageAutocomplete = {
return allowed;
}
$input.one('focus', function() {
$input.autocomplete({
minLength: 2,
source: function(request, response) {
@@ -240,6 +241,7 @@ var InputfieldPageAutocomplete = {
}
}
});
});
var makeSortable = function($ol) {
$ol.sortable({

File diff suppressed because one or more lines are too long

View File

@@ -177,7 +177,7 @@ class InputfieldPageAutocomplete extends Inputfield implements InputfieldHasArra
$operator = $this->operator;
$id = $this->id;
$max = (int) $this->maxSelectedItems;
$class = $this->useList ? 'has_list' : 'no_list';
$class = 'ui-autocomplete-input ' . ($this->useList ? 'has_list' : 'no_list');
if($this->useAndWords) $class .= " and_words";
if($this->allowAnyValue) $class .= " allow_any";

View File

@@ -331,5 +331,7 @@ $(document).ready(function() {
id: 'PageEditLinkTabs'
});
setTimeout(function() {
$('#link_page_url_input').focus();
}, 250);
});

File diff suppressed because one or more lines are too long