Skip to content
Snippets Groups Projects
Commit eaa85ff3 authored by Swen Vermeul's avatar Swen Vermeul
Browse files

notebook will automatically save itself when uploading

parent fa7a8c30
No related branches found
No related tags found
No related merge requests found
...@@ -475,33 +475,41 @@ define([ ...@@ -475,33 +475,41 @@ define([
saveState() saveState()
return true return true
} }
dialog_params = {
if (IPython.notebook.dirty === true) { body: uploadDialogBox,
dialog.modal({ title: 'Upload openBIS DataSet',
body: 'Please save the notebook before uploading it to openBIS.', buttons: {
title: 'Save notebook first', 'Cancel': {
buttons: { click: onCancel
'Back': {}
},
notebook: env.notebook,
keyboard_manager: env.notebook.keyboard_manager
})
} else {
dialog.modal({
body: uploadDialogBox,
title: 'Upload openBIS DataSet',
buttons: {
'Cancel': {
click: onCancel
},
'Upload': {
class: 'btn-primary btn-large',
click: onOk
}
}, },
notebook: env.notebook, 'Upload': {
keyboard_manager: env.notebook.keyboard_manager class: 'btn-primary btn-large',
}) click: onOk
}
},
notebook: env.notebook,
keyboard_manager: env.notebook.keyboard_manager
}
if (env.notebook.dirty === true) {
env.notebook.save_notebook()
.then(function () {
dialog.modal(dialog_params)
})
.catch(function (error) {
dialog.modal({
body: error,
title: 'Error saving the notebook',
buttons: {
'Back': {}
},
notebook: env.notebook,
keyboard_manager: env.notebook.keyboard_manager
})
})
}
else {
dialog.modal(dialog_params)
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment