Skip to content

Commit c4ffeb8

Browse files
Merge pull request AUTOMATIC1111#13480 from AUTOMATIC1111/popup-fix
Fix accidentally closing popup dialogs
2 parents dc2074c + e538132 commit c4ffeb8

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

javascript/extraNetworks.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,27 +222,24 @@ function extraNetworksSearchButton(tabs_id, event) {
222222

223223
var globalPopup = null;
224224
var globalPopupInner = null;
225+
225226
function closePopup() {
226227
if (!globalPopup) return;
227-
228228
globalPopup.style.display = "none";
229229
}
230+
230231
function popup(contents) {
231232
if (!globalPopup) {
232233
globalPopup = document.createElement('div');
233-
globalPopup.onclick = closePopup;
234234
globalPopup.classList.add('global-popup');
235235

236236
var close = document.createElement('div');
237237
close.classList.add('global-popup-close');
238-
close.onclick = closePopup;
238+
close.addEventListener("click", closePopup);
239239
close.title = "Close";
240240
globalPopup.appendChild(close);
241241

242242
globalPopupInner = document.createElement('div');
243-
globalPopupInner.onclick = function(event) {
244-
event.stopPropagation(); return false;
245-
};
246243
globalPopupInner.classList.add('global-popup-inner');
247244
globalPopup.appendChild(globalPopupInner);
248245

style.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,6 @@ table.popup-table .link{
585585
width: 100%;
586586
height: 100%;
587587
overflow: auto;
588-
background-color: rgba(20, 20, 20, 0.95);
589588
}
590589

591590
.global-popup *{
@@ -594,9 +593,6 @@ table.popup-table .link{
594593

595594
.global-popup-close:before {
596595
content: "×";
597-
}
598-
599-
.global-popup-close{
600596
position: fixed;
601597
right: 0.25em;
602598
top: 0;
@@ -605,10 +601,20 @@ table.popup-table .link{
605601
font-size: 32pt;
606602
}
607603

604+
.global-popup-close{
605+
position: fixed;
606+
left: 0;
607+
top: 0;
608+
width: 100%;
609+
height: 100%;
610+
background-color: rgba(20, 20, 20, 0.95);
611+
}
612+
608613
.global-popup-inner{
609614
display: inline-block;
610615
margin: auto;
611616
padding: 2em;
617+
z-index: 1001;
612618
}
613619

614620
/* fullpage image viewer */

0 commit comments

Comments
 (0)