Commit f117b725 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Merge branch 'ace_editor' into 'master'

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

See merge request !26
parents 7f21834d 805c65a3
......@@ -215,7 +215,7 @@
width = 200;\n
ace_editor_container_div.width(width);\n
\n
height = $(window).height() - ace_editor_container_div.offset().top * 2 - 1;\n
height = $(window).height() - ace_editor_container_div.offset().top - 40;\n
if(height < 400)\n
height = 400;\n
ace_editor_container_div.height(height);\n
......@@ -225,16 +225,14 @@
}\n
\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
function unmaximize(event) {\n
if(event.keyCode == 27) {\n
maximizeFullscreenRemoveSaveMessage();\n
$(\'body\').css(\'overflow\', \'visible\');\n
ace_editor_container_div.removeClass(\'maximize\');\n
ace_editor_container_div.appendTo(ace_editor_container_div_parent_before_maximized);\n
setContainerDivSize(event);\n
}\n
maximizeFullscreenRemoveSaveMessage();\n
$(\'body\').css(\'overflow\', \'visible\');\n
ace_editor_container_div.removeClass(\'maximize\');\n
ace_editor_container_div.appendTo(ace_editor_container_div_parent_before_maximized);\n
setContainerDivSize(event);\n
}\n
\n
function maximize() {\n
......@@ -253,8 +251,14 @@
ace_editor_maximize_mode_message.animate({opacity: 0.25}, 1500,\n
function() { $(this).remove(); });\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.focus()\n
}\n
\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
* 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