Skip to content

Commit 5881e94

Browse files
committed
move tool/menu build into init/
1 parent 0b3c0b9 commit 5881e94

4 files changed

Lines changed: 13 additions & 16 deletions

File tree

src/kiri/app/devices.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,5 +424,6 @@ function updateDeviceSelector(devices, selector, selected) {
424424
const seldev = dev_list.options[dev_list.selectedIndex];
425425
selectDevice(seldev.innerText);
426426
api.platform.layout();
427+
updateDeviceList();
427428
}
428429
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
22

3-
import { menubar } from './menubar.js';
4-
import { api } from './api.js';
3+
import { menubar } from './menu.js';
4+
import { api } from '../api.js';
55

6-
const toolbar = {
6+
const surfaces = {
77
build(actions = {}) {
88
const stop = (fn) => (ev) => {
99
ev?.stopPropagation?.();
@@ -20,4 +20,4 @@ const toolbar = {
2020
}
2121
};
2222

23-
export { toolbar };
23+
export { surfaces };
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
22

3-
import { $, h } from '../../moto/webui.js';
4-
import { api } from './api.js';
3+
import { $, h } from '../../../moto/webui.js';
4+
import { api } from '../api.js';
55

66
const { div, span, label, input, button, i, hr } = h;
77

@@ -52,13 +52,6 @@ function topMenu(actions, { text, lk, iconClass, side = 'left', right = false, i
5252
]);
5353
}
5454

55-
function toolbarToolNozzle() {
56-
return span({ id: 'tool-nozzle' }, [
57-
label({ lk: 'tool', _: tr('tool', 'tool') }),
58-
div({ id: 'ft-nozzle', class: 'f-col pop' })
59-
]);
60-
}
61-
6255
function rotatePanel(actions) {
6356
return div({ id: 'panel-rotate', class: 'selection-panel hide' }, [
6457
div({ id: 'panel-rotate-head', class: 'selection-panel-head' }, [
@@ -180,7 +173,10 @@ function content(actions) {
180173
]
181174
}),
182175
div({ class: 'f-row top-menu' }, [
183-
toolbarToolNozzle()
176+
span({ id: 'tool-nozzle' }, [
177+
label({ lk: 'tool', _: tr('tool', 'tool') }),
178+
div({ id: 'ft-nozzle', class: 'f-col pop' })
179+
])
184180
]),
185181
div({ class: 'grow' }),
186182
topMenu(actions, {

src/main/kiri.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { api } from '../kiri/app/api.js';
1010
import { init_lang } from '../kiri/app/init/lang.js';
1111
import { init_input } from '../kiri/app/init/input.js';
1212
import { init_sync } from '../kiri/app/init/sync.js';
13-
import { toolbar } from '../kiri/app/toolbar.js';
13+
import { surfaces } from '../kiri/app/init/build.js';
1414

1515
let traceload = location.search.indexOf('traceload') > 0;
1616
let load = [];
@@ -37,7 +37,7 @@ async function checkReady() {
3737
{
3838
api.client.start();
3939
await init_lang();
40-
toolbar.build();
40+
surfaces.build();
4141
await init_input();
4242
await init_sync();
4343
}

0 commit comments

Comments
 (0)