Fix keyboard shortcuts in kanban edit modal

pull/1/head
yflory 5 years ago
parent a2b6501adb
commit 15925f625d

@ -171,6 +171,7 @@ define([
h('label', {for:'cp-kanban-edit-color'}, Messages.kanban_color),
colors = h('div#cp-kanban-edit-colors'),
]);
var $tags = $(tagsDiv);
var $conflict = $(conflicts);
@ -217,11 +218,16 @@ define([
allowDropFileTypes: [],
lineWrapping: true,
styleActiveLine: true,
autoCloseBrackets: true,
inputStyle: 'contenteditable',
extraKeys: {"Shift-Ctrl-R": undefined},
mode: "gfm"
});
editor.on('keydown', function (editor, e) {
if (e.which === 27) {
// Focus the next form element but don't close the modal (stopPropagation)
$tags.find('.token-input').focus();
}
e.stopPropagation();
});
var common = framework._.sfCommon;
@ -255,7 +261,6 @@ define([
});
// Tags
var $tags = $(tagsDiv);
var _field, initialTags;
var tags = {
getValue: function () {
@ -278,6 +283,10 @@ define([
});
_field.setTokens(tags || []);
$tags.find('.token-input').on('keydown', function (e) {
e.stopPropagation();
});
var commitTags = function () {
setTimeout(function () {
dataObject.tags = Util.deduplicateString(_field.getTokens().map(function (t) {

Loading…
Cancel
Save