Merge branch 'MDL-59527-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE

This commit is contained in:
David Monllao
2017-07-17 14:08:28 +02:00
2 changed files with 12 additions and 5 deletions
File diff suppressed because one or more lines are too long
+11 -4
View File
@@ -536,7 +536,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
updateAjax(e, options, state, originalSelect, ajaxHandler);
});
} else {
// Else - open the suggestions list.
// Open the suggestions list.
updateSuggestions(options, state, inputElement.val(), originalSelect);
}
}
@@ -613,11 +613,18 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
});
if (options.showSuggestions) {
var arrowElement = $(document.getElementById(state.downArrowId));
arrowElement.on('click', function() {
arrowElement.on('click', function(e) {
// Prevent the close timer, or we will open, then close the suggestions.
inputElement.focus();
// Show the suggestions list.
updateSuggestions(options, state, inputElement.val(), originalSelect);
// Handle ajax population of suggestions.
if (!inputElement.val() && options.ajax) {
require([options.ajax], function(ajaxHandler) {
updateAjax(e, options, state, originalSelect, ajaxHandler);
});
} else {
// Else - open the suggestions list.
updateSuggestions(options, state, inputElement.val(), originalSelect);
}
});
}