Skip to content

Commit

Permalink
#6214 pass CodeCell to TreeWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
piorek committed Feb 7, 2018
1 parent fc1e495 commit e088b37
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion js/notebook/src/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ define([

var $ = require('jquery');
var Widget = require('@phosphor/widgets').Widget;
var CodeCell = require('notebook/js/codecell').CodeCell;

function load() {
console.log('tree.js load()');
var TreeWidget = require('./tree/TreeWidget').default;
var options = {
baseUrl: (Jupyter.notebook_list || Jupyter.notebook).base_url,
isLab: false,
CodeCell: Jupyter.CodeCell,
CodeCell: CodeCell,
};
var bxWidget = new TreeWidget(options);

Expand Down
3 changes: 2 additions & 1 deletion js/notebook/src/tree/Models/UIOptionsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ import IUIOptions from "../Types/IUIOptions";

export default class UIOptionsModel {

constructor(private widget: UIOptionsWidgetInterface) {
constructor(private widget: UIOptionsWidgetInterface, private CodeCell) {

}

public update(options: IUIOptions) {
this.widget.onLoad(options);
this.CodeCell.options_default.cm_config.autoCloseBrackets = options.auto_close;
}

}
2 changes: 1 addition & 1 deletion js/notebook/src/tree/TreeWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class TreeWidget extends Panel {
let uiOptionsModel;
if (false === this.options.isLab) {
uiOptionsWidget = new UIOptionsWidget();
uiOptionsModel = new UIOptionsModel(uiOptionsWidget);
uiOptionsModel = new UIOptionsModel(uiOptionsWidget, this.options.CodeCell);
}

this._model = new TreeWidgetModel(
Expand Down
2 changes: 1 addition & 1 deletion js/notebook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ module.exports = [
resolve: resolve,
externals: [
'base/js/namespace',
'base/js/utils',
'notebook/js/codecell',
'require',
],
watchOptions: {
Expand Down

0 comments on commit e088b37

Please sign in to comment.