You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WebCAD/src/index.tsx

45 lines
1.2 KiB

import * as React from "react";
7 years ago
import * as ReactDOM from 'react-dom';
import '../node_modules/golden-layout/src/css/goldenlayout-base.css';
import '../node_modules/golden-layout/src/css/goldenlayout-dark-theme.css';
import "./UI/Css/style.less"
import { LoadLayoutNotHead } from './UI/Layout/Layout';
import { CommandComponent } from "./UI/Components/Command";
import { App } from './UI/App';
7 years ago
import { commandStore, CommandMsg } from './UI/Store/CommandStore';
import { autorun, observable } from 'mobx';
import { Provider } from "mobx-react";
7 years ago
import { ApplicationService } from './ApplicationServices/Application';
function createRootElement()
7 years ago
{
var root = document.createElement('div');
root.id = "app"
7 years ago
root.style.height = "100%";
document.body.appendChild(root);
return root;
}
7 years ago
function renderCommand()
{
let commandEl = document.getElementById("commandContainer")
ReactDOM.render(
<Provider commandStore={commandStore}>
<CommandComponent />
</Provider>,
commandEl
)
}
7 years ago
7 years ago
function initApp()
{
7 years ago
new ApplicationService();
}
7 years ago
window.onload = function ()
{
createRootElement();
LoadLayoutNotHead();
renderCommand();
initApp();
};