From 0c81fc3f066403428cba2bd337d2baf74cc7b923 Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 20 Jun 2018 12:25:16 +0200 Subject: [PATCH] Remove ES6 syntax from save_notebook_as ES6 syntax is not available to us --- notebook/static/notebook/js/notebook.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/notebook/static/notebook/js/notebook.js b/notebook/static/notebook/js/notebook.js index 1af10f9ae..8c125f346 100644 --- a/notebook/static/notebook/js/notebook.js +++ b/notebook/static/notebook/js/notebook.js @@ -2885,7 +2885,7 @@ define([ 'type': 'notebook', 'content': that.toJSON(), 'name': nb_name - }; + }; return that.contents.save(nb_path, model) .then(function(data) { d.modal('hide'); @@ -2893,12 +2893,15 @@ define([ that.notebook_path = data.path; that.session.rename_notebook(data.path); that.events.trigger('notebook_renamed.Notebook', data); - - },function(error) { - const msg = i18n.msg._(error.message || 'Unknown error saving notebook'); - $('.save-message').html(`${msg}`); + }, function(error) { + var msg = i18n.msg._(error.message || 'Unknown error saving notebook'); + $(".save-message").html( + $("") + .attr("style", "color:red;") + .text(msg) + ); }); - } + }; that.contents.get(nb_path, {type: 'notebook', content: false}).then(function(data) { var warning_body = $('
').append( $("

").text(i18n.msg._('Notebook with that name exists.'))); @@ -2916,7 +2919,7 @@ define([ }); }, function(err) { return save_thunk(); - }) + }); return false; } }, @@ -2931,7 +2934,7 @@ define([ d.find('input[type="text"]').val(current_dir).focus(); } }); - } + }; /** * Update the autosave interval based on the duration of the last save. @@ -3473,4 +3476,4 @@ define([ }; return {Notebook: Notebook}; -}); \ No newline at end of file +});