Merge branch 'MDL-53349-31' of https://github.com/xow/moodle into MOODLE_31_STABLE

This commit is contained in:
Eloy Lafuente (stronk7)
2017-02-06 16:26:02 +01:00
2 changed files with 15 additions and 10 deletions
File diff suppressed because one or more lines are too long
+14 -9
View File
@@ -33,7 +33,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
ENTER: 13,
SPACE: 32,
ESCAPE: 27,
COMMA: 188,
COMMA: 44,
UP: 38
};
@@ -544,14 +544,6 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
// We handled this event, so prevent it.
e.preventDefault();
return false;
case KEYS.COMMA:
if (options.tags) {
// If we are allowing tags, comma should create a tag (or enter).
createItem(options, state, originalSelect);
}
// We handled this event, so prevent it.
e.preventDefault();
return false;
case KEYS.UP:
// Choose the previous active item.
activatePreviousItem(state);
@@ -582,6 +574,19 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
}
return true;
});
// Support multi lingual COMMA keycode (44).
inputElement.on('keypress', function(e) {
if (e.keyCode === KEYS.COMMA) {
if (options.tags) {
// If we are allowing tags, comma should create a tag (or enter).
createItem(options, state, originalSelect);
}
// We handled this event, so prevent it.
e.preventDefault();
return false;
}
return true;
});
// Handler used to force set the value from behat.
inputElement.on('behat:set-value', function() {
var suggestionsElement = $(document.getElementById(state.suggestionsId));