Made editor-resizing possible.
This commit is contained in:
@ -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({
|
||||
|
@ -9,7 +9,6 @@ button i.fa-spin {
|
||||
|
||||
.frame {
|
||||
display: none;
|
||||
height: 600px;
|
||||
|
||||
audio, img, video {
|
||||
max-width: 100%;
|
||||
|
Reference in New Issue
Block a user