diff --git a/ui.apps/src/main/content/jcr_root/apps/groovyconsole/clientlibs/js/services.js b/ui.apps/src/main/content/jcr_root/apps/groovyconsole/clientlibs/js/services.js index 54ebd936..8b37446a 100644 --- a/ui.apps/src/main/content/jcr_root/apps/groovyconsole/clientlibs/js/services.js +++ b/ui.apps/src/main/content/jcr_root/apps/groovyconsole/clientlibs/js/services.js @@ -7,16 +7,17 @@ $(function () { scriptEditor.navigateFileEnd(); - if (scriptEditor.getCursorPosition().column > 0) { + if (scriptEditor.getCursorPosition().column > 0 ) { scriptEditor.insert('\n\n'); } - scriptEditor.insert(declaration); - + if((event.keyCode === 13 || event.which === 13)) { + scriptEditor.insert(declaration); + } return ''; } }); $('#btn-group-services').fadeIn('fast'); }); -}); \ No newline at end of file +});