Commit c9a17d6e authored by Tristan Cavelier's avatar Tristan Cavelier

erp5_svg_editor: fix should autofocus editor to enable keyboard shortcuts

also prevent from going backward by pressing backspace
parent f5e12409
......@@ -44,6 +44,7 @@
async: true,\n
success: function (text_content) {\n
var svg_canvas, frame = window.frames.svgframe;\n
frame.focus();\n
if (text_content !== "") {\n
svg_canvas = frame.svgCanvas;\n
svg_canvas.ready(function () {\n
......@@ -68,6 +69,12 @@ $(document).ready(function () {\n
});\n
});\n
$("iframe#svgframe").css("border", "0px");\n
});\n
\n
window.addEventListener("keydown", function (event) {\n
if (event.keyCode === 8) {\n
event.preventDefault();\n
}\n
});</unicode> </value>
</item>
<item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment