leaving tags box will create tag

v1.18.x
barisusakli 11 years ago
parent 4570edb122
commit 09d4f4b47b

@ -35,6 +35,17 @@ define('composer/tags', function() {
select: function(event, ui) { select: function(event, ui) {
// when autocomplete is selected from the dropdown simulate a enter key down to turn it into a tag // when autocomplete is selected from the dropdown simulate a enter key down to turn it into a tag
// http://stackoverflow.com/a/3276819/583363 // http://stackoverflow.com/a/3276819/583363
triggerEnter(input);
}
});
input.attr('tabIndex', tagEl.attr('tabIndex'));
input.on('blur', function() {
triggerEnter(input);
})
};
function triggerEnter(input) {
var e = jQuery.Event('keydown'); var e = jQuery.Event('keydown');
e.which = 13; e.which = 13;
e.keyCode = 13; e.keyCode = 13;
@ -42,10 +53,6 @@ define('composer/tags', function() {
input.trigger(e); input.trigger(e);
}, 100); }, 100);
} }
});
input.attr('tabIndex', tagEl.attr('tabIndex'));
};
function addTags(tags, tagEl) { function addTags(tags, tagEl) {
if (tags && tags.length) { if (tags && tags.length) {

Loading…
Cancel
Save