diff --git a/website/index/index.js b/website/index/index.js index 32fd7955..6533f2d1 100644 --- a/website/index/index.js +++ b/website/index/index.js @@ -66,11 +66,20 @@ function loadSample(mode) { $('.loading.editor').show(); }, error: function () { + if (editor) { + if (editor.getModel()) { + editor.getModel().dispose(); + } + editor.dispose(); + editor = null; + } $('.loading.editor').fadeOut({ duration: 200 }); - $('#editor').append('

Failed to load ' + mode.name + ' sample

'); + $('#editor').empty(); + $('#editor').append('

Failed to load ' + mode.modeId + ' sample

'); } }).done(function (data) { if (!editor) { + $('#editor').empty(); editor = monaco.editor.create(document.getElementById('editor'), { model: null, }); diff --git a/website/index/samples/sample.sass.txt b/website/index/samples/sample.scss.txt similarity index 100% rename from website/index/samples/sample.sass.txt rename to website/index/samples/sample.scss.txt