##// END OF EJS Templates
s/current_selection/default_kernel/
Min RK -
Show More
@@ -14,7 +14,7 define([
14 14 this.base_url = options.base_url;
15 15 this.notebook_path = options.notebook_path;
16 16 this.contents = options.contents;
17 this.current_selection = null;
17 this.default_kernel = null;
18 18 this.config = options.config;
19 19 this.kernelspecs = {};
20 20 if (this.selector !== undefined) {
@@ -74,20 +74,20 define([
74 74 NewNotebookWidget.prototype._load_default_kernelspec = function (default_name) {
75 75 /** load default kernelspec name from config, if defined */
76 76 if (this.config.data.NewNotebookWidget &&
77 this.config.data.NewNotebookWidget.current_selection &&
78 this.kernelspecs[this.config.data.NewNotebookWidget.current_selection] !== undefined
77 this.config.data.NewNotebookWidget.default_kernel &&
78 this.kernelspecs[this.config.data.NewNotebookWidget.default_kernel] !== undefined
79 79 ) {
80 default_name = this.config.data.NewNotebookWidget.current_selection;
80 default_name = this.config.data.NewNotebookWidget.default_kernel;
81 81 }
82 82 this.set_default_kernel(default_name);
83 83 };
84 84
85 85 NewNotebookWidget.prototype.set_default_kernel = function (kernel_name) {
86 86 /** select the current default kernel */
87 this.current_selection = kernel_name;
87 this.default_kernel = kernel_name;
88 88 this.config.update({
89 89 NewNotebookWidget: {
90 current_selection: kernel_name
90 default_kernel: kernel_name
91 91 }
92 92 });
93 93 var spec = this.kernelspecs[kernel_name];
@@ -108,7 +108,7 define([
108 108 NewNotebookWidget.prototype.new_notebook = function (kernel_name) {
109 109 /** create and open a new notebook */
110 110 var that = this;
111 kernel_name = kernel_name || this.current_selection;
111 kernel_name = kernel_name || this.default_kernel;
112 112 var w = window.open();
113 113 this.contents.new_untitled(that.notebook_path, {type: "notebook"}).then(
114 114 function (data) {
General Comments 0
You need to be logged in to leave comments. Login now