summaryrefslogtreecommitdiff
path: root/kvmd/web/js/ui.js
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-07-25 19:15:04 +0300
committerDevaev Maxim <[email protected]>2018-07-25 19:15:04 +0300
commite2e8001ba8dec95742e6c121c7252b4fd5634b7d (patch)
tree5f688e80fb2c6bc68c81cc924b4e86186510d77a /kvmd/web/js/ui.js
parent79c92afb7f7cddfb380bd64af790d96f9dddc42e (diff)
windows stack
Diffstat (limited to 'kvmd/web/js/ui.js')
-rw-r--r--kvmd/web/js/ui.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/kvmd/web/js/ui.js b/kvmd/web/js/ui.js
index dd7d7a4d..59968956 100644
--- a/kvmd/web/js/ui.js
+++ b/kvmd/web/js/ui.js
@@ -1,4 +1,6 @@
var ui = new function() {
+ var __top_z_index = 1;
+
this.init = function() {
Array.prototype.forEach.call(document.getElementsByClassName("ctl-item"), function(el_item) {
el_item.onclick = function() { __toggleMenu(el_item); };
@@ -44,6 +46,7 @@ var ui = new function() {
var prev_y = 0;
function startMoving(event) {
+ __raiseWindow(el_body);
event = (event || window.event);
event.preventDefault();
prev_x = event.clientX;
@@ -69,5 +72,11 @@ var ui = new function() {
}
el_header.onmousedown = startMoving;
+ el_body.onclick = function () { __raiseWindow(el_body) };
+ };
+
+ var __raiseWindow = function(el_body) {
+ __top_z_index += 1;
+ el_body.style.zIndex = __top_z_index;
};
};