stop event propagation from tag prompt

This commit is contained in:
ansuz 2017-10-05 15:08:34 +02:00
parent c936e5ae73
commit 1f35798194

View file

@ -191,6 +191,8 @@ define([
var listener;
var close = Util.once(function (result, ev) {
ev.stopPropagation();
ev.preventDefault();
var $frame = $(tagger).fadeOut(150, function () {
stopListening(listener);
$frame.remove();
@ -198,17 +200,21 @@ define([
});
});
var $ok = findOKButton(tagger).click(function () {
var $ok = findOKButton(tagger).click(function (e) {
var tokens = field.getTokens();
close(tokens);
close(tokens, e);
});
var $cancel = findCancelButton(tagger).click(function () {
close(null);
var $cancel = findCancelButton(tagger).click(function (e) {
close(null, e);
});
listenForKeys(function () {
$ok.click();
}, function () {
$cancel.click();
}, tagger);
$(tagger).on('click submit', function (e) {
e.stopPropagation();
});
document.body.appendChild(tagger);