Commit 80ae4c54 authored by Jérome Perrin's avatar Jérome Perrin

code mirror: cancel pending AJAX call to check source code when document is modified again

parent 417c07be
......@@ -445,12 +445,18 @@
is_maximized = true;\n
}\n
\n
var timer = 0;\n
function checkPythonSourceCode(text, updateLinting, options, cm) {\n
checker_parameters = {code: text};\n
<dtml-if bound_names>\n
checker_parameters[\'bound_names\'] = <dtml-var name="bound_names">;\n
checker_parameters[\'params\'] = $(\'input[name="params"]\').val();\n
</dtml-if>\n
if (timer) {\n
window.clearTimeout(timer);\n
timer = 0;\n
}\n
timer = window.setTimeout(function() {\n
$.post(\n
\'&dtml-portal_url;/ERP5Site_checkPythonSourceCodeAsJSON\',\n
{\'data\': JSON.stringify(checker_parameters)},\n
......@@ -466,9 +472,9 @@
severity: message.type\n
});\n
}\n
\n
updateLinting(cm, found);\n
});\n
}, 500);\n
}\n
\n
var mode = "&dtml-mode;";\n
......
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