personal-website/resources/sys/finder/finder.js

40 lines
1.1 KiB
JavaScript

class Finder{
appId = "finder"
/**
* @param {HTMLElement} appElem
*/
constructor(appElem){
this.appElem = appElem
}
/**
* @param {string} path
*/
NewWindow(path){
console.log("Init")
fetch(`${window.location.origin}/application/${this.appId}/render`) //TODO Move to wde func. Or Not?
.then((response) => response.text())
.then((html) => {
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, "Personal Properties", 500, 400 )
newWindow.innerHTML = html
console.log(newWindow.children[1].children[0])
let fileView = new FileView("/kek", newWindow.children[1].children[0])
let scrollBar = new WdeScrollBar(newWindow.children[1].children[1], newWindow.children[1].children[0])
let closeButton = newWindow.children[0].children[0]
closeButton.addEventListener('click', function (params) {
WebDesktopEnvironment.CloseWindow(newWindow)
})
})
.catch((error) => {
WebDesktopEnvironment.Alert(error);
})
}
}