Skip to content

Commit 0c81fc3

Browse files
committed
Remove ES6 syntax from save_notebook_as
ES6 syntax is not available to us
1 parent 81c6eed commit 0c81fc3

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

notebook/static/notebook/js/notebook.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2885,20 +2885,23 @@ define([
28852885
'type': 'notebook',
28862886
'content': that.toJSON(),
28872887
'name': nb_name
2888-
};
2888+
};
28892889
return that.contents.save(nb_path, model)
28902890
.then(function(data) {
28912891
d.modal('hide');
28922892
that.notebook_name = data.name;
28932893
that.notebook_path = data.path;
28942894
that.session.rename_notebook(data.path);
28952895
that.events.trigger('notebook_renamed.Notebook', data);
2896-
2897-
},function(error) {
2898-
const msg = i18n.msg._(error.message || 'Unknown error saving notebook');
2899-
$('.save-message').html(`<span style='color:red;'>${msg}</span>`);
2896+
}, function(error) {
2897+
var msg = i18n.msg._(error.message || 'Unknown error saving notebook');
2898+
$(".save-message").html(
2899+
$("<span>")
2900+
.attr("style", "color:red;")
2901+
.text(msg)
2902+
);
29002903
});
2901-
}
2904+
};
29022905
that.contents.get(nb_path, {type: 'notebook', content: false}).then(function(data) {
29032906
var warning_body = $('<div/>').append(
29042907
$("<p/>").text(i18n.msg._('Notebook with that name exists.')));
@@ -2916,7 +2919,7 @@ define([
29162919
});
29172920
}, function(err) {
29182921
return save_thunk();
2919-
})
2922+
});
29202923
return false;
29212924
}
29222925
},
@@ -2931,7 +2934,7 @@ define([
29312934
d.find('input[type="text"]').val(current_dir).focus();
29322935
}
29332936
});
2934-
}
2937+
};
29352938

29362939
/**
29372940
* Update the autosave interval based on the duration of the last save.
@@ -3473,4 +3476,4 @@ define([
34733476
};
34743477

34753478
return {Notebook: Notebook};
3476-
});
3479+
});

0 commit comments

Comments
 (0)