Commit e594a856 authored by Arnaud Fontaine's avatar Arnaud Fontaine

erp5_code_mirror: Allow saving with C-s in the ZMI.

Signed-off-by: Jérome Perrin's avatarJérome Perrin <jerome@nexedi.com>
parent c85a840f
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
}\n }\n
\n \n
// Save source code only through an AJAX request\n // Save source code only through an AJAX request\n
function saveDocument(cm, event) {\n function saveComponentDocument(cm, event) {\n
event.stopPropagation();\n event.stopPropagation();\n
event.preventDefault();\n event.preventDefault();\n
\n \n
...@@ -332,9 +332,19 @@ ...@@ -332,9 +332,19 @@
data: edit_data,\n data: edit_data,\n
success: successHandler,\n success: successHandler,\n
error: errorHandler});\n error: errorHandler});\n
\n \n
return false;\n return false;\n
}\n }\n
\n
function saveZMIDocument(cm, event) {\n
$(\'input[value="Save Changes"]\').click();\n
return false;\n
}\n
\n
if($(\'input[value="Save Changes"]\').length)\n
saveDocument = saveZMIDocument;\n
else\n
saveDocument = saveComponentDocument;\n
\n \n
function switchToFullScreen(cm) {\n function switchToFullScreen(cm) {\n
element = $(\'#merge\')[0];\n element = $(\'#merge\')[0];\n
......
2015-05-08 arnaud.fontaine
* Allow saving with C-s in the ZMI.
2015-04-23 arnaud.fontaine 2015-04-23 arnaud.fontaine
* Add support for the ZMI. * Add support for the ZMI.
......
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