windows stack

This commit is contained in:
Devaev Maxim 2018-07-25 19:15:04 +03:00
parent 79c92afb7f
commit e2e8001ba8
2 changed files with 11 additions and 2 deletions

View File

@ -25,7 +25,7 @@ ul#ctl {
position: fixed; position: fixed;
top: 0; top: 0;
width: 100%; width: 100%;
z-index: 10; z-index: 2147483647;
} }
ul#ctl li.ctl-logo { ul#ctl li.ctl-logo {
float: left; float: left;
@ -64,7 +64,7 @@ div.ctl-dropdown-content {
background-color: var(--bg-color-ctl); background-color: var(--bg-color-ctl);
min-width: 180px; min-width: 180px;
box-shadow: var(--big-shadow); box-shadow: var(--big-shadow);
z-index: 9; z-index: 2147483646;
} }
div.ctl-dropdown-content div.buttons-row { div.ctl-dropdown-content div.buttons-row {
margin: 0; margin: 0;

View File

@ -1,4 +1,6 @@
var ui = new function() { var ui = new function() {
var __top_z_index = 1;
this.init = function() { this.init = function() {
Array.prototype.forEach.call(document.getElementsByClassName("ctl-item"), function(el_item) { Array.prototype.forEach.call(document.getElementsByClassName("ctl-item"), function(el_item) {
el_item.onclick = function() { __toggleMenu(el_item); }; el_item.onclick = function() { __toggleMenu(el_item); };
@ -44,6 +46,7 @@ var ui = new function() {
var prev_y = 0; var prev_y = 0;
function startMoving(event) { function startMoving(event) {
__raiseWindow(el_body);
event = (event || window.event); event = (event || window.event);
event.preventDefault(); event.preventDefault();
prev_x = event.clientX; prev_x = event.clientX;
@ -69,5 +72,11 @@ var ui = new function() {
} }
el_header.onmousedown = startMoving; 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;
}; };
}; };