Fixes #9: handle errors correctly, fix scss file name

pull/12/head
Alex Dima 9 years ago
parent 62030f63a6
commit 4e34ca8bdf

@ -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('<p class="alert alert-error">Failed to load ' + mode.name + ' sample</p>');
$('#editor').empty();
$('#editor').append('<p class="alert alert-error">Failed to load ' + mode.modeId + ' sample</p>');
}
}).done(function (data) {
if (!editor) {
$('#editor').empty();
editor = monaco.editor.create(document.getElementById('editor'), {
model: null,
});

Loading…
Cancel
Save