##// END OF EJS Templates
Fixing broken notebook saves.
Brian Granger -
Show More
@@ -1098,27 +1098,25 b' var IPython = (function (IPython) {'
1098 };
1098 };
1099
1099
1100 Notebook.prototype.save_notebook = function () {
1100 Notebook.prototype.save_notebook = function () {
1101 if (IPython.save_widget.test_notebook_name()) {
1101 var notebook_id = IPython.save_widget.get_notebook_id();
1102 var notebook_id = IPython.save_widget.get_notebook_id();
1102 var nbname = IPython.save_widget.get_notebook_name();
1103 var nbname = IPython.save_widget.get_notebook_name();
1103 // We may want to move the name/id/nbformat logic inside toJSON?
1104 // We may want to move the name/id/nbformat logic inside toJSON?
1104 var data = this.toJSON();
1105 var data = this.toJSON();
1105 data.metadata.name = nbname;
1106 data.metadata.name = nbname;
1106 data.nbformat = 2;
1107 data.nbformat = 2;
1107 // We do the call with settings so we can set cache to false.
1108 // We do the call with settings so we can set cache to false.
1108 var settings = {
1109 var settings = {
1109 processData : false,
1110 processData : false,
1110 cache : false,
1111 cache : false,
1111 type : "PUT",
1112 type : "PUT",
1112 data : JSON.stringify(data),
1113 data : JSON.stringify(data),
1113 headers : {'Content-Type': 'application/json'},
1114 headers : {'Content-Type': 'application/json'},
1114 success : $.proxy(this.notebook_saved,this),
1115 success : $.proxy(this.notebook_saved,this),
1115 error : $.proxy(this.notebook_save_failed,this)
1116 error : $.proxy(this.notebook_save_failed,this)
1117 };
1118 IPython.save_widget.status_saving();
1119 var url = $('body').data('baseProjectUrl') + 'notebooks/' + notebook_id;
1120 $.ajax(url, settings);
1121 };
1116 };
1117 IPython.save_widget.status_saving();
1118 var url = $('body').data('baseProjectUrl') + 'notebooks/' + notebook_id;
1119 $.ajax(url, settings);
1122 };
1120 };
1123
1121
1124
1122
General Comments 0
You need to be logged in to leave comments. Login now