personal-website/resources/personal-properties/personal-properties.js

49 lines
1.5 KiB
JavaScript

class PersonalProperties{
appId = "personal-properties"
/**
* @param {HTMLElement} appElem
*/
constructor(appElem){
this.appElem = appElem
}
Init(){
console.log("Init")
// this.appElem.innerHTML = WebDesktopEnvironment.GetBasicWindow()
// console.log(this.appElem)
// let contentFrame = this.appElem.children[0].children[0].children[1]
fetch("http://localhost:8080/application/personal-properties/render") //TODO Move to wde func
.then((response) => response.text())
.then((html) => {
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, "Personal Properties", 350, 750) //TODO Get ~70% of user screen height
newWindow.innerHTML = html
// document.getElementById("closeWindowButton").onclick = function jsFunc() {
// console.log("keeek")
// }
// console.log(newWindow.children[0].children[0])
let closeButton = newWindow.children[0].children[0]
// console.log(closeButton)
// // closeButton.onclick = this.CloseWindow("test")
closeButton.addEventListener('click', function (params) {
WebDesktopEnvironment.CloseWindow(newWindow)
})
})
.catch((error) => {
WebDesktopEnvironment.Alert(error);
});
}
CloseWindow(id){
console.log(id+"Close")
}
}
function reply_click(){
console.log("QQQQQQQQQQQQQQQQQQQ")
}