Commit 792434e4 authored by Gabriel Monnerat's avatar Gabriel Monnerat

- refactor code to call function only when the text content of document is not blank;

- reload the page when the script finish

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44516 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 45281487
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
url: "getTextContent",\n url: "getTextContent",\n
async: false\n async: false\n
}).responseText;\n }).responseText;\n
svg_canvas.setSvgString(text_content);\n text_content != "" ? svg_canvas.setSvgString(text_content) : null;\n
}\n }\n
\n \n
$(document).ready(function(){\n $(document).ready(function(){\n
...@@ -55,8 +55,10 @@ $(document).ready(function(){\n ...@@ -55,8 +55,10 @@ $(document).ready(function(){\n
type: "POST",\n type: "POST",\n
url: "Base_setTextContentWrapper",\n url: "Base_setTextContentWrapper",\n
data: "text=" + svg_canvas.getSvgString(),\n data: "text=" + svg_canvas.getSvgString(),\n
success: function(){\n
window.location.reload();\n
}\n
});\n });\n
window.location.reload();\n
});\n });\n
var text_content = $.ajax({\n var text_content = $.ajax({\n
url: "getTextContent",\n url: "getTextContent",\n
......
24 25
\ No newline at end of file \ No newline at end of file
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