stop event propagation from tag prompt
This commit is contained in:
parent
c936e5ae73
commit
1f35798194
1 changed files with 10 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue