Merge branch 'MDL-51964-master' of git://github.com/damyon/moodle

This commit is contained in:
Andrew Nicols
2015-11-02 10:52:37 +08:00
2 changed files with 12 additions and 2 deletions
File diff suppressed because one or more lines are too long
+11 -1
View File
@@ -693,7 +693,17 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
// Whenever the input field changes, update the suggestion list.
inputElement.on('input', function(e) {
var query = $(e.currentTarget).val();
updateSuggestions(query, inputId, suggestionsId, originalSelect, multiple, tags, caseSensitive);
var last = $(e.currentTarget).data('last-value');
if (typeof last === 'undefined') {
last = query;
}
// IE11 fires many more input events than required - even when the value has not changed.
// We need to only do this for real value changed events or the suggestions will be
// unclickable on IE11 (because they will be rebuilt before the click event fires).
if (last != query) {
updateSuggestions(query, inputId, suggestionsId, originalSelect, multiple, tags, caseSensitive);
$(e.currentTarget).data('last-value', query);
}
});
};