|
@@ -169,6 +169,8 @@ export class StaticNotebook extends Widget {
|
|
|
options.contentFactory || StaticNotebook.defaultContentFactory;
|
|
|
this.editorConfig =
|
|
|
options.editorConfig || StaticNotebook.defaultEditorConfig;
|
|
|
+ this.notebookConfig =
|
|
|
+ options.notebookConfig || StaticNotebook.defaultNotebookConfig;
|
|
|
this._mimetypeService = options.mimeTypeService;
|
|
|
}
|
|
|
|
|
@@ -261,6 +263,17 @@ export class StaticNotebook extends Widget {
|
|
|
this._updateEditorConfig();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * A configuration object for notebook settings.
|
|
|
+ */
|
|
|
+ get notebookConfig(): StaticNotebook.INotebookConfig {
|
|
|
+ return this._notebookConfig;
|
|
|
+ }
|
|
|
+ set notebookConfig(value: StaticNotebook.INotebookConfig) {
|
|
|
+ this._notebookConfig = value;
|
|
|
+ this._updateNotebookConfig();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Dispose of the resources held by the widget.
|
|
|
*/
|
|
@@ -558,7 +571,18 @@ export class StaticNotebook extends Widget {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Update editor settings for notebook.
|
|
|
+ */
|
|
|
+ private _updateNotebookConfig() {
|
|
|
+ this.toggleClass(
|
|
|
+ 'jp-mod-scrollPastEnd',
|
|
|
+ this._notebookConfig.scrollPastEnd
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
private _editorConfig = StaticNotebook.defaultEditorConfig;
|
|
|
+ private _notebookConfig = StaticNotebook.defaultNotebookConfig;
|
|
|
private _mimetype = 'text/plain';
|
|
|
private _model: INotebookModel = null;
|
|
|
private _mimetypeService: IEditorMimeTypeService;
|
|
@@ -594,6 +618,11 @@ export namespace StaticNotebook {
|
|
|
*/
|
|
|
editorConfig?: IEditorConfig;
|
|
|
|
|
|
+ /**
|
|
|
+ * A configuration object for notebook settings.
|
|
|
+ */
|
|
|
+ notebookConfig?: INotebookConfig;
|
|
|
+
|
|
|
/**
|
|
|
* The service used to look up mime types.
|
|
|
*/
|
|
@@ -673,6 +702,22 @@ export namespace StaticNotebook {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ /**
|
|
|
+ * A config object for the notebook widget
|
|
|
+ */
|
|
|
+ export interface INotebookConfig {
|
|
|
+ /**
|
|
|
+ * Enable scrolling past the last cell
|
|
|
+ */
|
|
|
+ scrollPastEnd: boolean;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Default configuration options for notebooks.
|
|
|
+ */
|
|
|
+ export const defaultNotebookConfig: INotebookConfig = {
|
|
|
+ scrollPastEnd: true
|
|
|
+ };
|
|
|
+
|
|
|
/**
|
|
|
* The default implementation of an `IContentFactory`.
|
|
|
*/
|