65 lines
2.3 KiB
JavaScript
65 lines
2.3 KiB
JavaScript
class PersonalProperties{
|
|
appId = "personal-properties"
|
|
/**
|
|
* @param {HTMLElement} appElem
|
|
*/
|
|
constructor(appElem){
|
|
this.appElem = appElem
|
|
}
|
|
|
|
/**
|
|
* @param {string} path
|
|
*/
|
|
NewWindow(path){
|
|
fetch(`${window.location.origin}/application/personal-properties/render`) //TODO Move to wde func. Or Not?
|
|
.then((response) => response.text())
|
|
.then((html) => {
|
|
// console.log(document.body)
|
|
// let heigth = Math.max(document.body.clientHeight*0.8, scrollDiv.children[0].scrollHeight) //TODO
|
|
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, 360, document.body.clientHeight*0.8 )
|
|
|
|
newWindow.innerHTML = html
|
|
|
|
let closeButton = newWindow.children[0].children[0]
|
|
let scrollDiv = newWindow.children[1]
|
|
let scrollBar = new WdeScrollBar(scrollDiv.children[1].children[0], scrollDiv.children[0])
|
|
|
|
closeButton.addEventListener('click', function (params) {
|
|
WebDesktopEnvironment.CloseWindow(newWindow)
|
|
})
|
|
})
|
|
.catch((error) => {
|
|
WebDesktopEnvironment.Alert(error);
|
|
});
|
|
}
|
|
|
|
// Init(){
|
|
// console.log("Init")
|
|
// fetch(`${window.location.origin}/application/personal-properties/render`) //TODO Move to wde func. Or Not?
|
|
// .then((response) => response.text())
|
|
// .then((html) => {
|
|
// // console.log(document.body)
|
|
// // let heigth = Math.max(document.body.clientHeight*0.8, scrollDiv.children[0].scrollHeight) //TODO
|
|
// let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, "Personal Properties", 360, document.body.clientHeight*0.8 )
|
|
|
|
// newWindow.innerHTML = html
|
|
|
|
// let closeButton = newWindow.children[0].children[0]
|
|
// let scrollDiv = newWindow.children[1]
|
|
// let scrollBar = new WdeScrollBar(scrollDiv.children[1].children[0], scrollDiv.children[0])
|
|
|
|
// closeButton.addEventListener('click', function (params) {
|
|
// WebDesktopEnvironment.CloseWindow(newWindow)
|
|
// })
|
|
// })
|
|
// .catch((error) => {
|
|
// WebDesktopEnvironment.Alert(error);
|
|
// });
|
|
// }
|
|
}
|
|
|
|
|
|
class test{
|
|
|
|
}
|