@voila-dashboards/jupyterlab-gridstack
Version:
A gridstack-based template for [](https://github.com/voila-dashboards/voila).
19 lines (18 loc) • 600 B
JavaScript
import { ReactWidget, ToolbarButtonComponent } from '@jupyterlab/apputils';
import { undoIcon } from '@jupyterlab/ui-components';
import * as React from 'react';
/**
* A toolbar widget to reload the dashboard positions from disk.
*/
export default class Revert extends ReactWidget {
constructor(panel) {
super();
this._panel = panel;
}
render() {
const onClick = () => {
this._panel.revert();
};
return (React.createElement(ToolbarButtonComponent, { icon: undoIcon, onClick: onClick, tooltip: 'Reload Notebook from Disk' }));
}
}