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 @@ ...@@ -44,6 +44,7 @@
async: true,\n async: true,\n
success: function (text_content) {\n success: function (text_content) {\n
var svg_canvas, frame = window.frames.svgframe;\n var svg_canvas, frame = window.frames.svgframe;\n
frame.focus();\n
if (text_content !== "") {\n if (text_content !== "") {\n
svg_canvas = frame.svgCanvas;\n svg_canvas = frame.svgCanvas;\n
svg_canvas.ready(function () {\n svg_canvas.ready(function () {\n
...@@ -68,6 +69,12 @@ $(document).ready(function () {\n ...@@ -68,6 +69,12 @@ $(document).ready(function () {\n
});\n });\n
});\n });\n
$("iframe#svgframe").css("border", "0px");\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> });</unicode> </value>
</item> </item>
<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