run in IE11

This commit is contained in:
Alexandru Dima 2019-10-03 15:33:55 +02:00
parent 7104a97f34
commit b7194c4617
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0

View file

@ -179,7 +179,7 @@ function createButton(label, onClick) {
function createOptions(editor) { function createOptions(editor) {
var options = document.getElementById('options'); var options = document.getElementById('options');
let lineNumbers; var lineNumbers;
options.appendChild(createOptionToggle( options.appendChild(createOptionToggle(
editor, editor,
'lineNumbers', 'lineNumbers',
@ -189,10 +189,10 @@ function createOptions(editor) {
function(editor, newValue) { function(editor, newValue) {
lineNumbers = newValue; lineNumbers = newValue;
editor.updateOptions({ lineNumbers: lineNumbers ? 'on' : 'off' }); editor.updateOptions({ lineNumbers: lineNumbers ? 'on' : 'off' });
}, }
)); ));
let glyphMargin; var glyphMargin;
options.appendChild(createOptionToggle( options.appendChild(createOptionToggle(
editor, editor,
'glyphMargin', 'glyphMargin',
@ -205,7 +205,7 @@ function createOptions(editor) {
} }
)); ));
let minimap; var minimap;
options.appendChild(createOptionToggle( options.appendChild(createOptionToggle(
editor, editor,
'minimap', 'minimap',
@ -218,7 +218,7 @@ function createOptions(editor) {
} }
)); ));
let roundedSelection; var roundedSelection;
options.appendChild(createOptionToggle( options.appendChild(createOptionToggle(
editor, editor,
'roundedSelection', 'roundedSelection',
@ -231,31 +231,33 @@ function createOptions(editor) {
} }
)); ));
let scrollBeyondLastLine; var scrollBeyondLastLine;
options.appendChild(createOptionToggle( options.appendChild(createOptionToggle(
editor, editor,
'scrollBeyondLastLine', 'scrollBeyondLastLine',
function() { function() {
return (scrollBeyondLastLine === false ? false : true); return (scrollBeyondLastLine === false ? false : true);
}, function(editor, newValue) { },
function(editor, newValue) {
scrollBeyondLastLine = newValue; scrollBeyondLastLine = newValue;
editor.updateOptions({ scrollBeyondLastLine: scrollBeyondLastLine }); editor.updateOptions({ scrollBeyondLastLine: scrollBeyondLastLine });
} }
)); ));
let renderWhitespace; var renderWhitespace;
options.appendChild(createOptionToggle( options.appendChild(createOptionToggle(
editor, editor,
'renderWhitespace', 'renderWhitespace',
function() { function() {
return (renderWhitespace === true ? true : false); return (renderWhitespace === true ? true : false);
}, function(editor, newValue) { },
function(editor, newValue) {
renderWhitespace = newValue; renderWhitespace = newValue;
editor.updateOptions({ renderWhitespace: renderWhitespace }); editor.updateOptions({ renderWhitespace: renderWhitespace });
} }
)); ));
let readOnly; var readOnly;
options.appendChild(createOptionToggle( options.appendChild(createOptionToggle(
editor, editor,
'readOnly', 'readOnly',
@ -268,25 +270,27 @@ function createOptions(editor) {
} }
)); ));
let wordWrap; var wordWrap;
options.appendChild(createOptionToggle( options.appendChild(createOptionToggle(
editor, editor,
'wordWrap', 'wordWrap',
function() { function() {
return (wordWrap === true ? true : false); return (wordWrap === true ? true : false);
}, function(editor, newValue) { },
function(editor, newValue) {
wordWrap = newValue; wordWrap = newValue;
editor.updateOptions({ wordWrap: wordWrap ? 'on' : 'off' }); editor.updateOptions({ wordWrap: wordWrap ? 'on' : 'off' });
} }
)); ));
let folding; var folding;
options.appendChild(createOptionToggle( options.appendChild(createOptionToggle(
editor, editor,
'folding', 'folding',
function() { function() {
return (folding === false ? false : true); return (folding === false ? false : true);
}, function(editor, newValue) { },
function(editor, newValue) {
folding = newValue; folding = newValue;
editor.updateOptions({ folding: folding }); editor.updateOptions({ folding: folding });
} }