Made editor-resizing possible.

This commit is contained in:
Alexander Kastius
2016-09-09 13:42:51 +02:00
parent 952cc5ec24
commit bac86cd466
2 changed files with 12 additions and 1 deletions

View File

@ -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({

View File

@ -9,7 +9,6 @@ button i.fa-spin {
.frame {
display: none;
height: 600px;
audio, img, video {
max-width: 100%;