Skip to content

Commit

Permalink
Fix errors due to refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ricktu288 committed Dec 12, 2024
1 parent cdd68a9 commit 7c2eb45
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/simulator/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1418,10 +1418,11 @@ function initTools() {

if (element.id && element.id.startsWith('tool_')) {
const toolId = element.id.replace('tool_', '').replace('_mobile', '');
element.addEventListener('click', (event) => {
//console.log('tool_' + toolId);
toolbtn_clicked(toolId);
});
if (sceneObjs[toolId] || toolId == '') {
element.addEventListener('click', (event) => {
toolbtn_clicked(toolId);
});
}
}
});

Expand All @@ -1444,11 +1445,13 @@ function initModes() {
allElements.forEach(element => {
if (element.id && element.id.startsWith('mode_')) {
const modeId = element.id.replace('mode_', '').replace('_mobile', '');
element.addEventListener('click', (event) => {
//console.log('mode_' + modeId);
modebtn_clicked(modeId);
editor.onActionComplete();
});
if (['rays', 'extended', 'images', 'observer'].includes(modeId)) {
element.addEventListener('click', (event) => {
//console.log('mode_' + modeId);
modebtn_clicked(modeId);
editor.onActionComplete();
});
}
}
});
}
Expand Down

0 comments on commit 7c2eb45

Please sign in to comment.