diff --git a/app/assets/javascripts/editor/editor.js.erb b/app/assets/javascripts/editor/editor.js.erb index 7a0a3a7e..eafe6f44 100644 --- a/app/assets/javascripts/editor/editor.js.erb +++ b/app/assets/javascripts/editor/editor.js.erb @@ -15,6 +15,7 @@ var CodeOceanEditor = { AUTOSAVE_INTERVAL: 15 * 1000, REQUEST_FOR_COMMENTS_DELAY: 3 * 60 * 1000, REQUEST_TOOLTIP_TIME: 5000, + EDITOR_HEIGHT_SUBST: 100, NONE: 0, WEBSOCKET: 1, @@ -201,6 +202,15 @@ var CodeOceanEditor = { initializeEditors: function () { $('.editor').each(function (index, element) { + // Resize frame. + var windowHeight = window.innerHeight - this.EDITOR_HEIGHT_SUBST; + $(element).parent().height(windowHeight); + + $(window).resize(function(){ + var windowHeight = window.innerHeight - this.EDITOR_HEIGHT_SUBST; + $(element).parent().height(windowHeight); + }.bind(this)); + var editor = ace.edit(element); if (this.qa_api) { @@ -222,6 +232,8 @@ var CodeOceanEditor = { editor.setShowPrintMargin(false); editor.setTheme(this.THEME); + + // set options for autocompletion if($(element).data('allow-auto-completion')){ editor.setOptions({ diff --git a/app/assets/stylesheets/editor.css.scss b/app/assets/stylesheets/editor.css.scss index a331572a..807f4435 100644 --- a/app/assets/stylesheets/editor.css.scss +++ b/app/assets/stylesheets/editor.css.scss @@ -9,7 +9,6 @@ button i.fa-spin { .frame { display: none; - height: 600px; audio, img, video { max-width: 100%;