Skip to content

Commit 86a46e8

Browse files
committed
Fix accidentally closing popup dialogs
1 parent 5ef669d commit 86a46e8

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

javascript/extraNetworks.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -216,27 +216,24 @@ function extraNetworksSearchButton(tabs_id, event) {
216216

217217
var globalPopup = null;
218218
var globalPopupInner = null;
219+
219220
function closePopup() {
220221
if (!globalPopup) return;
221-
222222
globalPopup.style.display = "none";
223223
}
224+
224225
function popup(contents) {
225226
if (!globalPopup) {
226227
globalPopup = document.createElement('div');
227-
globalPopup.onclick = closePopup;
228228
globalPopup.classList.add('global-popup');
229-
229+
230230
var close = document.createElement('div');
231231
close.classList.add('global-popup-close');
232-
close.onclick = closePopup;
232+
close.addEventListener("click", closePopup);
233233
close.title = "Close";
234234
globalPopup.appendChild(close);
235235

236236
globalPopupInner = document.createElement('div');
237-
globalPopupInner.onclick = function(event) {
238-
event.stopPropagation(); return false;
239-
};
240237
globalPopupInner.classList.add('global-popup-inner');
241238
globalPopup.appendChild(globalPopupInner);
242239

style.css

+10-4
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,6 @@ table.popup-table .link{
581581
width: 100%;
582582
height: 100%;
583583
overflow: auto;
584-
background-color: rgba(20, 20, 20, 0.95);
585584
}
586585

587586
.global-popup *{
@@ -590,9 +589,6 @@ table.popup-table .link{
590589

591590
.global-popup-close:before {
592591
content: "×";
593-
}
594-
595-
.global-popup-close{
596592
position: fixed;
597593
right: 0.25em;
598594
top: 0;
@@ -601,10 +597,20 @@ table.popup-table .link{
601597
font-size: 32pt;
602598
}
603599

600+
.global-popup-close{
601+
position: fixed;
602+
left: 0;
603+
top: 0;
604+
width: 100%;
605+
height: 100%;
606+
background-color: rgba(20, 20, 20, 0.95);
607+
}
608+
604609
.global-popup-inner{
605610
display: inline-block;
606611
margin: auto;
607612
padding: 2em;
613+
z-index: 1001;
608614
}
609615

610616
/* fullpage image viewer */

0 commit comments

Comments
 (0)