fix close buttons

This commit is contained in:
cyber-dream 2023-04-13 21:28:28 +03:00
parent 6ef9ac2df1
commit 10a7cf9301
2 changed files with 6 additions and 8 deletions

View File

@ -20,8 +20,7 @@ class Finder{
let fileView = new FileView("/kek", newWindow.querySelector(".FileTileView"), Finder.Click)
if (!WebDesktopEnvironment.isMobile){
let scrollBar = new WdeScrollBar(newWindow.children[1].children[1], newWindow.children[1].children[0])// TODO to querry selector
let closeButton = newWindow.querySelector("#closeWindowButton")
closeButton.addEventListener('click', function (params) {
newWindow.querySelector("#closeWindowButton").addEventListener('click', function (params) {
WebDesktopEnvironment.CloseWindow(newWindow)
})
}

View File

@ -10,14 +10,13 @@ class ImgViewer{
.then((response) => response.text())
.then((html) => {
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, 450,400 )
newWindow.innerHTML = html
let closeButton = newWindow.children[0].children[0]
closeButton.addEventListener('click', function (params) {
WebDesktopEnvironment.CloseWindow(newWindow)
})
if (!WebDesktopEnvironment.isMobile){
newWindow.querySelector("#closeWindowButton").addEventListener('click', function (params) {
WebDesktopEnvironment.CloseWindow(newWindow)
})
}
})
.catch((error) => {
WebDesktopEnvironment.Alert(error);