Chore: housekeeping

This commit is contained in:
Pieter Vander Vennet 2023-07-28 01:02:31 +02:00
parent 89027ed516
commit 7d51c94e1f
21 changed files with 622 additions and 427 deletions

View file

@ -1,6 +1,6 @@
import BaseUIElement from "../BaseUIElement"
import {InputElement} from "./InputElement"
import {UIEventSource} from "../../Logic/UIEventSource"
import { InputElement } from "./InputElement"
import { UIEventSource } from "../../Logic/UIEventSource"
/**
* @deprecated
@ -67,20 +67,18 @@ export default class FileSelectorButton extends InputElement<FileList> {
if (actualInputElement.files !== null) {
self._value.setData(actualInputElement.files)
}
actualInputElement.classList.remove("glowing-shadow");
actualInputElement.classList.remove("glowing-shadow")
e.preventDefault()
})
el.appendChild(actualInputElement)
function setDrawAttention(isOn: boolean){
if(isOn){
function setDrawAttention(isOn: boolean) {
if (isOn) {
label.classList.add("glowing-shadow")
}else{
} else {
label.classList.remove("glowing-shadow")
}
}
@ -90,10 +88,9 @@ export default class FileSelectorButton extends InputElement<FileList> {
setDrawAttention(true)
// Style the drag-and-drop as a "copy file" operation.
event.dataTransfer.dropEffect = "copy"
})
window.document.addEventListener("dragenter", () =>{
window.document.addEventListener("dragenter", () => {
setDrawAttention(true)
})
@ -101,7 +98,6 @@ export default class FileSelectorButton extends InputElement<FileList> {
setDrawAttention(false)
})
el.addEventListener("drop", (event) => {
event.stopPropagation()
event.preventDefault()