|
@@ -9,8 +9,6 @@ import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
|
|
|
|
|
|
import { Token } from '@lumino/coreutils';
|
|
|
|
|
|
-import { Throttler } from '@lumino/polling';
|
|
|
-
|
|
|
import { JupyterFrontEnd, JupyterFrontEndPlugin } from './frontend';
|
|
|
|
|
|
import { createRendermimePlugins } from './mimerenderers';
|
|
@@ -85,18 +83,6 @@ export class JupyterLab extends JupyterFrontEnd<ILabShell> {
|
|
|
this.registerPlugin(plugin);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- void this.restored.then(() => {
|
|
|
- this.formatChanged.connect((_, format) => {
|
|
|
- if (format === 'mobile') {
|
|
|
- this.shell.mode = 'single-document';
|
|
|
- this.shell.collapseLeft();
|
|
|
- this.shell.collapseRight();
|
|
|
- return;
|
|
|
- }
|
|
|
- }, this);
|
|
|
- Private.setFormat(this);
|
|
|
- });
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -144,18 +130,6 @@ export class JupyterLab extends JupyterFrontEnd<ILabShell> {
|
|
|
return this._paths;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Handle the DOM events for the application.
|
|
|
- *
|
|
|
- * @param event - The DOM event sent to the application.
|
|
|
- */
|
|
|
- handleEvent(event: Event): void {
|
|
|
- super.handleEvent(event);
|
|
|
- if (event.type === 'resize') {
|
|
|
- void this._formatter.invoke();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Register plugins from a plugin module.
|
|
|
*
|
|
@@ -190,9 +164,6 @@ export class JupyterLab extends JupyterFrontEnd<ILabShell> {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- private _formatter = new Throttler(() => {
|
|
|
- Private.setFormat(this);
|
|
|
- }, 250);
|
|
|
private _info: JupyterLab.IInfo;
|
|
|
private _paths: JupyterFrontEnd.IPaths;
|
|
|
}
|
|
@@ -299,22 +270,3 @@ export namespace JupyterLab {
|
|
|
| JupyterFrontEndPlugin<any, any, any>[];
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-/**
|
|
|
- * A namespace for module-private functionality.
|
|
|
- */
|
|
|
-namespace Private {
|
|
|
- /**
|
|
|
- * Media query for mobile devices.
|
|
|
- */
|
|
|
- const MOBILE_QUERY = 'only screen and (max-width: 760px)';
|
|
|
-
|
|
|
- /**
|
|
|
- * Sets the `format` of a Jupyter front-end application.
|
|
|
- *
|
|
|
- * @param app The front-end application whose format is set.
|
|
|
- */
|
|
|
- export function setFormat(app: JupyterLab): void {
|
|
|
- app.format = window.matchMedia(MOBILE_QUERY).matches ? 'mobile' : 'desktop';
|
|
|
- }
|
|
|
-}
|