Resolve deprecation warnings for ACE Editor 1.32.6
This commit is contained in:

committed by
Sebastian Serth

parent
b00d45521b
commit
e366ebd34c
@ -282,14 +282,14 @@ var CodeOceanEditor = {
|
||||
var editor = ace.edit(element);
|
||||
|
||||
var document = editor.getSession().getDocument();
|
||||
// insert pre-existing code into editor. we have to use insertLines, otherwise the deltas are not properly added
|
||||
// insert pre-existing code into editor. we have to use insertFullLines, otherwise the deltas are not properly added
|
||||
var file_id = $(element).data('file-id');
|
||||
var content = $('.editor-content[data-file-id=' + file_id + ']');
|
||||
this.setActiveFile($(element).parent().data('filename'), file_id);
|
||||
|
||||
document.insertLines(0, content.text().split(/\n/));
|
||||
document.insertFullLines(0, content.text().split(/\n/));
|
||||
// remove last (empty) that is there by default line
|
||||
document.removeLines(document.getLength() - 1, document.getLength() - 1);
|
||||
document.removeFullLines(document.getLength() - 1, document.getLength() - 1);
|
||||
editor.setReadOnly($(element).parent().data('read-only') !== undefined);
|
||||
if (editor.getReadOnly()) {
|
||||
editor.setHighlightActiveLine(false);
|
||||
|
Reference in New Issue
Block a user