Commit c2971907 authored by dcoudrin's avatar dcoudrin
Browse files

disabling gui view for now

parent d3f3287f
......@@ -117,6 +117,7 @@ jupyter: biocham biocham_kernel/commands.js biocham_kernel/commands.py
- jupyter kernelspec install --user --name=biocham biocham_kernel
- jupyter nbextension install --user biocham_gui/menu
- jupyter nbextension enable --user menu/main
- jupyter nbextension disable biocham_gui/dist/bundle
biocham_kernel/commands.py: biocham
......
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import './styles/styles.css';
import 'react-grid-layout/css/styles.css';
import 'react-resizable/css/styles.css';
import 'react-tabs/style/react-tabs.css';
/**
*
*/
function createSwitchButton () {
let toolbarButton = document.createElement('button');
toolbarButton.id = 'switch-btn';
toolbarButton.classList.add('btn', 'btn-xs', 'navbar-btn', 'notification_widget');
toolbarButton.innerText = 'GUI';
let helpMenu = document.querySelector('#help_menu').parentElement;
helpMenu.parentElement.insertBefore(toolbarButton, helpMenu);
toolbarButton.onclick = switchView;
}
function switchView () {
let notebookView = document.getElementById('notebook_panel');
let guiPanel = document.getElementById('gui_panel');
let btn = document.getElementById('switch-btn');
let toolbar = document.getElementById('maintoolbar');
let notebookDisplay = notebookView.style.display;
if (!notebookDisplay) {
notebookDisplay = 'block';
}
let guiDisplay = guiPanel.style.display;
if (notebookDisplay === 'none' && guiDisplay !== 'none') {
Jupyter.keyboard_manager.enable();
notebookView.style.display = 'block';
guiPanel.style.display = 'none';
toolbar.style.display = 'block';
btn.innerText = 'GUI';
}
else if (notebookDisplay === 'block' && guiDisplay === 'none') {
// Need to disable the notebook shortcuts when in the GUI
Jupyter.keyboard_manager.disable();
notebookView.style.display = 'none';
guiPanel.style.display = 'block';
toolbar.style.display = 'none';
btn.innerText = 'Notebook';
}
}
function initGUI() {
let guiPanel = document.createElement('div');
guiPanel.id = 'gui_panel';
guiPanel.style.display = 'none';
document.getElementById('ipython-main-app').appendChild(guiPanel);
createSwitchButton();
}
export function load_ipython_extension() {
//initGUI();
ReactDOM.render(
<App />,
document.getElementById('gui_panel')
);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment