Commit 5ebfc13e authored by Boris Kocherov's avatar Boris Kocherov

erp5_ace_editor: change unmaximize button to Alt-m, set focus to ace editor after maximize

escape button for unmaximize is useless because the close of search dialog
 (ctrl-f) conflict
parent 0ae57f92
...@@ -225,16 +225,14 @@ ...@@ -225,16 +225,14 @@
}\n }\n
\n \n
ace_editor_container_div_parent_before_maximized = null;\n ace_editor_container_div_parent_before_maximized = null;\n
ace_editor_maximize_mode_message = $(\'<span id=&quot;maximize_message&quot;>Press ESC to leave maximize mode</span>\');\n ace_editor_maximize_mode_message = $(\'<span id=&quot;maximize_message&quot;>Press Alt-M to leave maximize mode</span>\');\n
\n \n
function unmaximize(event) {\n function unmaximize(event) {\n
if(event.keyCode == 27) {\n maximizeFullscreenRemoveSaveMessage();\n
maximizeFullscreenRemoveSaveMessage();\n $(\'body\').css(\'overflow\', \'visible\');\n
$(\'body\').css(\'overflow\', \'visible\');\n ace_editor_container_div.removeClass(\'maximize\');\n
ace_editor_container_div.removeClass(\'maximize\');\n ace_editor_container_div.appendTo(ace_editor_container_div_parent_before_maximized);\n
ace_editor_container_div.appendTo(ace_editor_container_div_parent_before_maximized);\n setContainerDivSize(event);\n
setContainerDivSize(event);\n
}\n
}\n }\n
\n \n
function maximize() {\n function maximize() {\n
...@@ -253,8 +251,14 @@ ...@@ -253,8 +251,14 @@
ace_editor_maximize_mode_message.animate({opacity: 0.25}, 1500,\n ace_editor_maximize_mode_message.animate({opacity: 0.25}, 1500,\n
function() { $(this).remove(); });\n function() { $(this).remove(); });\n
\n \n
$(document).keyup(unmaximize);\n ace_editor.commands.addCommand({\n
name: \'unmaximize\',\n
bindKey: {win: \'Alt-m\', mac: \'Alt-m\'},\n
exec: unmaximize\n
});\n
\n
ace_editor.resize(true);\n ace_editor.resize(true);\n
ace_editor.focus()\n
}\n }\n
\n \n
// Save source code only through an AJAX request\n // Save source code only through an AJAX request\n
......
2015-11-14 bk
* change unmaximize button to Alt-m
* set focus to ace editor after maximize
2014-02-25 arnaud.fontaine 2014-02-25 arnaud.fontaine
* Allow to specify the line to go to from URL parameter. * Allow to specify the line to go to from URL parameter.
......
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