move tool/menu build into init/
This commit is contained in:
parent
0b3c0b929a
commit
5881e94ecd
4 changed files with 13 additions and 16 deletions
|
|
@ -424,5 +424,6 @@ function updateDeviceSelector(devices, selector, selected) {
|
|||
const seldev = dev_list.options[dev_list.selectedIndex];
|
||||
selectDevice(seldev.innerText);
|
||||
api.platform.layout();
|
||||
updateDeviceList();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
|
||||
|
||||
import { menubar } from './menubar.js';
|
||||
import { api } from './api.js';
|
||||
import { menubar } from './menu.js';
|
||||
import { api } from '../api.js';
|
||||
|
||||
const toolbar = {
|
||||
const surfaces = {
|
||||
build(actions = {}) {
|
||||
const stop = (fn) => (ev) => {
|
||||
ev?.stopPropagation?.();
|
||||
|
|
@ -20,4 +20,4 @@ const toolbar = {
|
|||
}
|
||||
};
|
||||
|
||||
export { toolbar };
|
||||
export { surfaces };
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
|
||||
|
||||
import { $, h } from '../../moto/webui.js';
|
||||
import { api } from './api.js';
|
||||
import { $, h } from '../../../moto/webui.js';
|
||||
import { api } from '../api.js';
|
||||
|
||||
const { div, span, label, input, button, i, hr } = h;
|
||||
|
||||
|
|
@ -52,13 +52,6 @@ function topMenu(actions, { text, lk, iconClass, side = 'left', right = false, i
|
|||
]);
|
||||
}
|
||||
|
||||
function toolbarToolNozzle() {
|
||||
return span({ id: 'tool-nozzle' }, [
|
||||
label({ lk: 'tool', _: tr('tool', 'tool') }),
|
||||
div({ id: 'ft-nozzle', class: 'f-col pop' })
|
||||
]);
|
||||
}
|
||||
|
||||
function rotatePanel(actions) {
|
||||
return div({ id: 'panel-rotate', class: 'selection-panel hide' }, [
|
||||
div({ id: 'panel-rotate-head', class: 'selection-panel-head' }, [
|
||||
|
|
@ -180,7 +173,10 @@ function content(actions) {
|
|||
]
|
||||
}),
|
||||
div({ class: 'f-row top-menu' }, [
|
||||
toolbarToolNozzle()
|
||||
span({ id: 'tool-nozzle' }, [
|
||||
label({ lk: 'tool', _: tr('tool', 'tool') }),
|
||||
div({ id: 'ft-nozzle', class: 'f-col pop' })
|
||||
])
|
||||
]),
|
||||
div({ class: 'grow' }),
|
||||
topMenu(actions, {
|
||||
|
|
@ -10,7 +10,7 @@ import { api } from '../kiri/app/api.js';
|
|||
import { init_lang } from '../kiri/app/init/lang.js';
|
||||
import { init_input } from '../kiri/app/init/input.js';
|
||||
import { init_sync } from '../kiri/app/init/sync.js';
|
||||
import { toolbar } from '../kiri/app/toolbar.js';
|
||||
import { surfaces } from '../kiri/app/init/build.js';
|
||||
|
||||
let traceload = location.search.indexOf('traceload') > 0;
|
||||
let load = [];
|
||||
|
|
@ -37,7 +37,7 @@ async function checkReady() {
|
|||
{
|
||||
api.client.start();
|
||||
await init_lang();
|
||||
toolbar.build();
|
||||
surfaces.build();
|
||||
await init_input();
|
||||
await init_sync();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue