Fix channel password prompt

Add zin param to allow explicit z-index in JS generated dialog boxes.
Give needpass dialog explicit z-index
This commit is contained in:
Xaekai 2020-03-29 09:35:09 -07:00 committed by Calvin Montgomery
parent 47bb3e47a2
commit a53f65a1d5
2 changed files with 12 additions and 3 deletions

View File

@ -139,7 +139,7 @@ Callbacks = {
.css("margin-top", "5px")
.text("Submit")
.appendTo(div);
var parent = chatDialog(div);
var parent = chatDialog(div, '9999');
parent.attr("id", "needpw");
var sendpw = function () {
socket.emit("channelPassword", pwbox.val());

View File

@ -2097,11 +2097,20 @@ function waitUntilDefined(obj, key, fn) {
fn();
}
function chatDialog(div) {
/*
God I hate supporting IE11
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters
https://caniuse.com/#search=default%20function
This would be the ideal:
function chatDialog(div, zin = "auto") {
*/
function chatDialog(div, zin) {
if(!zin){ zin = 'auto'; }
var parent = $("<div/>").addClass("profile-box")
.css({
padding: "10px",
"z-index": "auto",
"z-index": zin,
position: "absolute"
})
.appendTo($("#chatwrap"));