Skip to content

Commit

Permalink
point to the correct api, gather the needed resources in that for pas…
Browse files Browse the repository at this point in the history
…sing to the json object
  • Loading branch information
mpacer committed Oct 6, 2017
1 parent 7c875ba commit 1a1d09d
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions notebook/static/notebook/js/menubar.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,30 +194,31 @@ define('notebook/js/menubar',[
form.append(fileformat);
form.append(fileinput);
body.append(form);

var that = this;
that["format"] = fileformat.val()
// really would like to have fileformat accessible inside the filereader.onload but it seems to be out of scope

var trigger_nbconvert_post = function() {
var trigger_nbconvert_post = () => {
var filereader = new FileReader();
filereader.onload = function() {
filereader.onload = () => {
var my_config_data = filereader.result;
that["json_content"] = create_json(that.notebook, my_config_data);
that["json_content"] = build_json_for_post(that.notebook, my_config_data, that.format);
on_done();
};
if (fileinput[0].files.length > 0) {
filereader.readAsText(fileinput[0].files[0]);
} else {
that["json_content"] = create_json(that.notebook, "{}");
that["json_content"] = build_json_for_post(that.notebook, "{}", that.format);
on_done();
}
};
var on_done = function() {

var on_done = () => {
var url =
utils.url_path_join(
that.base_url,
"nbconvert",
fileformat.val(),
notebook_path
"nbconvert-service",
) +
"?download=" +
download.toString();
Expand Down

0 comments on commit 1a1d09d

Please sign in to comment.