fixing keys when focused
parent
790e694c5a
commit
5701ab72b5
|
@ -59,7 +59,8 @@ MD.Keyboard = function(){
|
|||
};
|
||||
|
||||
document.addEventListener("keydown", function(e){
|
||||
if ($("#color_picker").is(":visible")) return e;
|
||||
const exceptions = $(":focus").length || $("#color_picker").is(":visible");
|
||||
if (exceptions) return false;
|
||||
const modKey = !svgedit.browser.isMac() ? "ctrlKey" : "metaKey";
|
||||
const cmd = e[modKey] ? "cmd_" : "";
|
||||
const shift = e.shiftKey ? "shift_" : "";
|
||||
|
@ -92,7 +93,6 @@ MD.Keyboard = function(){
|
|||
e.preventDefault();
|
||||
keys[key]();
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
// modal shortcuts
|
||||
|
|
|
@ -141,6 +141,9 @@ MD.Editor = function(){
|
|||
function escapeMode(){
|
||||
for (key in editor.modal) editor.modal[key].close();
|
||||
state.set("canvasMode", "select");
|
||||
if ($("#cur_context_panel").is(":visible"))
|
||||
svgCanvas.leaveContext()
|
||||
else
|
||||
state.set("canvasContent", svgCanvas.getSvgString())
|
||||
}
|
||||
|
||||
|
@ -191,6 +194,7 @@ MD.Editor = function(){
|
|||
elems: elems
|
||||
});
|
||||
|
||||
// todo svgCanvas.getCurrentContext is needed
|
||||
if (!$("#cur_context_panel").is(":visible"))
|
||||
state.set("canvasContent", svgCanvas.getSvgString())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue