mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 06:07:57 +01:00
bugfixing for keypress events when user wrinting in a topic
This commit is contained in:
parent
1708787747
commit
8436ad286c
@ -255,23 +255,25 @@ mindplot.DesignerKeyboard = new Class({
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$(document).on('keydown', function (event) {
|
$(document).on('keypress', function (event) {
|
||||||
|
|
||||||
var keyCode = event.keyCode;
|
var keyCode = event.keyCode;
|
||||||
|
|
||||||
if (!jQuery.hotkeys.specialKeys[keyCode] && !jQuery.hotkeys.shiftNums[keyCode] && keyCode != 91 /*win key*/) {
|
var specialKey = jQuery.hotkeys.specialKeys[keyCode];
|
||||||
|
if (["enter", "capslock"].indexOf(specialKey) == -1 && !jQuery.hotkeys.shiftNums[keyCode] && keyCode != 91 /*win key*/) {
|
||||||
var nodes = designer.getModel().filterSelectedTopics();
|
var nodes = designer.getModel().filterSelectedTopics();
|
||||||
if (nodes.length > 0) {
|
if (nodes.length > 0) {
|
||||||
|
|
||||||
// If a modifier is press, the key selected must be ignored.
|
// If a modifier is press, the key selected must be ignored.
|
||||||
var pressKey = String.fromCharCode(keyCode);
|
var pressKey = String.fromCharCode(keyCode);
|
||||||
if (event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) {
|
if (event.ctrlKey || event.altKey || event.metaKey) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
nodes[0].showTextEditor(pressKey);
|
nodes[0].showTextEditor(pressKey);
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user