mirror of
https://github.com/sotam0316/drawNET_test.git
synced 2026-04-25 12:08:37 +09:00
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
import { state } from '../../state.js';
|
|
|
|
export const uiHandlers = {
|
|
toggleInventory: () => {
|
|
import('../../graph/analysis.js').then(m => m.toggleInventory());
|
|
},
|
|
toggleProperties: () => {
|
|
import('../../properties_sidebar/index.js').then(m => m.toggleSidebar());
|
|
},
|
|
toggleLayers: () => {
|
|
import('../../ui/layer_panel.js').then(m => m.toggleLayerPanel());
|
|
},
|
|
editLabel: () => {
|
|
if (!state.graph) return;
|
|
const selected = state.graph.getSelectedCells();
|
|
if (selected.length === 0) return;
|
|
|
|
import('../../properties_sidebar/index.js').then(m => {
|
|
m.toggleSidebar(true);
|
|
setTimeout(() => {
|
|
const labelInput = document.getElementById('prop-label');
|
|
if (labelInput) {
|
|
labelInput.focus();
|
|
labelInput.select();
|
|
}
|
|
}, 50);
|
|
});
|
|
},
|
|
cancel: () => {
|
|
if (!state.graph) return;
|
|
state.graph.cleanSelection();
|
|
import('../../properties_sidebar/index.js').then(m => m.toggleSidebar(false));
|
|
}
|
|
};
|