Fix modals to appear in fixed position, and ensure Android compat gets checked (#21279)

* Fix modals to appear in fixed position, and ensure Android compat gets checked

* No need to wrap this
This commit is contained in:
Mathieu Pillard 2023-10-05 15:55:33 +02:00 коммит произвёл GitHub
Родитель 0682bdea6f
Коммит 6654db6bbf
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -1365,7 +1365,14 @@ function initSubmitModals() {
return false;
}
if (confirmedOnce) {
$input.prop('checked', !$input.prop('checked'));
setTimeout(function () {
// $().modal() calls preventDefault() before firing the callback
// but the checkbox is temporarily checked anyway when clicking on
// it (not the label). To work around this, we wrap our toggling
// in a setTimeout() to force it to wait for the event to be
// processed.
$input.prop('checked', !$input.prop('checked'));
}, 0);
}
return !confirmedOnce;
},

Просмотреть файл

@ -311,7 +311,7 @@ $.fn.modal = function (click_target, o) {
top: toY + 'px',
right: 'inherit',
bottom: 'inherit',
position: 'absolute',
position: 'fixed',
});
return $modal;
};