fix: bootstrap5 modal

This commit is contained in:
2021-12-11 00:28:59 +09:00
parent 9da82dd205
commit a4e8edce73
3 changed files with 36 additions and 28 deletions
+4 -3
View File
@@ -9,6 +9,7 @@ import { numberWithCommas } from "@util/numberWithCommas";
import { unwrap_any } from '@util/unwrap_any';
import { BasicGeneralListResponse, InvalidResponse } from '@/defs';
import { formatTime } from '@util/formatTime';
import { Modal } from 'bootstrap';
type CityAttackerInfo = {
level: number,
@@ -222,7 +223,7 @@ $(function ($) {
const $modal = $('#importModal');
$modal.data('target', $card);
$modal.modal('show');
new Modal($modal[0]).show();
});
$('.btn-general-save').on('click', function () {
@@ -959,7 +960,7 @@ $(function ($) {
const $card = $modal.data('target');
importGeneralInfo($card, data.general);
$modal.modal('hide');
new Modal($modal[0]).hide();
}, errUnknown);
@@ -1008,7 +1009,7 @@ $(function ($) {
}).then(function (data: BasicGeneralListResponse | InvalidResponse) {
if (!data.result) {
alert(data.reason);
$('#importModal').modal('hide');
new Modal(unwrap(document.querySelector('#importModal'))).hide();
return false;
}