Merge branch 'MDL-66312-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
@@ -712,24 +712,29 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
|
||||
window.setTimeout(function() {
|
||||
// Get the current element with focus.
|
||||
var focusElement = $(document.activeElement);
|
||||
var timeoutPromise = $.Deferred();
|
||||
|
||||
// Only close the menu if the input hasn't regained focus, and if the element still exists.
|
||||
// Due to the half a second delay, it is possible that the input element no longer exist
|
||||
// by the time this code is being executed.
|
||||
if (focusElement.attr('id') != inputElement.attr('id') && $('#' + state.inputId).length) {
|
||||
if (options.tags) {
|
||||
pendingPromise.then(function() {
|
||||
timeoutPromise.then(function() {
|
||||
return createItem(options, state, originalSelect);
|
||||
})
|
||||
.catch();
|
||||
}
|
||||
pendingPromise.then(function() {
|
||||
timeoutPromise.then(function() {
|
||||
return closeSuggestions(state);
|
||||
})
|
||||
.catch();
|
||||
}
|
||||
|
||||
pendingPromise.resolve();
|
||||
timeoutPromise.then(function() {
|
||||
return pendingPromise.resolve();
|
||||
})
|
||||
.catch();
|
||||
timeoutPromise.resolve();
|
||||
}, 500);
|
||||
});
|
||||
if (options.showSuggestions) {
|
||||
|
||||
Reference in New Issue
Block a user