Skip to content

Commit 5e64112

Browse files
committed
On opening a window, if it is already open, the window is the active one
1 parent e9a52c9 commit 5e64112

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<body>
1515

1616
<header>
17-
<p>Window Engine 4.2</p>
17+
<p>Window Engine 4.2.1</p>
1818
</header>
1919

2020
<div class="windowGroup">

window-engine/window-engine.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ function createWindow(id) {
2020
};
2121
document.getElementById("button" + id).onclick = function () {
2222
if (document.getElementById("window" + id).style.display === "initial") {
23+
activeWindow();
24+
document.getElementById("window" + id).className += " windowActive";
2325
isOut = false;
2426
}
2527
if (isOut) {
@@ -141,4 +143,4 @@ function activeWindow() {
141143
for (let i = active.length - 1; i > -1; i--) {
142144
active[i].classList.remove("windowActive");
143145
}
144-
}
146+
}

window-engine/window-engine.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)