Use bootstrap-icons; refactor some JS
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { Controller } from "@hotwired/stimulus"
|
||||
import API_CONFIG from "../config.js";
|
||||
|
||||
/**
|
||||
* @todo Handle errors
|
||||
@@ -12,7 +11,7 @@ export default class extends Controller {
|
||||
'buildingForm'
|
||||
];
|
||||
|
||||
API_BASE = API_CONFIG.dev;
|
||||
API_BASE = window.API_CONFIG.dev;
|
||||
|
||||
async submit(event) {
|
||||
event.preventDefault();
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import { Controller } from '@hotwired/stimulus';
|
||||
|
||||
/*
|
||||
* This is an example Stimulus controller!
|
||||
*
|
||||
* Any element with a data-controller="hello" attribute will cause
|
||||
* this controller to be executed. The name "hello" comes from the filename:
|
||||
* hello_controller.js -> "hello"
|
||||
*
|
||||
* Delete this file or adapt it for your use!
|
||||
*/
|
||||
export default class extends Controller {
|
||||
connect() {
|
||||
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js';
|
||||
}
|
||||
}
|
||||
43
assets/controllers/scene_controller.js
Normal file
43
assets/controllers/scene_controller.js
Normal file
@@ -0,0 +1,43 @@
|
||||
import { Controller } from '@hotwired/stimulus';
|
||||
import UI from '../ui.js';
|
||||
import BIM from '../bim.js';
|
||||
|
||||
/*
|
||||
* This is an example Stimulus controller!
|
||||
*
|
||||
* Any element with a data-controller="hello" attribute will cause
|
||||
* this controller to be executed. The name "hello" comes from the filename:
|
||||
* hello_controller.js -> "hello"
|
||||
*
|
||||
* Delete this file or adapt it for your use!
|
||||
*/
|
||||
export default class extends Controller {
|
||||
static targets = ['scene'];
|
||||
|
||||
connect() {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Element} container
|
||||
*/
|
||||
sceneTargetConnected(container) {
|
||||
UI.setScene(container);
|
||||
const model = UI.ifcLoader(container);
|
||||
container.ondblclick = () => BIM.activateClipper();
|
||||
container.onkeydown = event => {
|
||||
console.log(event);
|
||||
if (event.code === 'Delete' || event.code === 'Backspace') {
|
||||
BIM.deleteClipper();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Event} event
|
||||
*/
|
||||
keyboard(event) {
|
||||
console.log(event);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user