Restore modals to their original size after done with viewing originals

This commit is contained in:
Bobby Wibowo 2018-10-19 21:57:15 +07:00
parent a3c9eeb3c5
commit e5417f0aa2
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
3 changed files with 11 additions and 3 deletions

View File

@ -6,6 +6,11 @@
text-align: initial;
}
.swal-modal.is-expanded {
width: auto;
max-width: 90%;
}
.swal-title,
.swal-text {
color: #eff0f1;

View File

@ -570,8 +570,8 @@ page.displayThumbnail = function (id) {
button.style.display = 'none'
}
// Resize currently visible modal
document.body.querySelector('.swal-overlay--show-modal .swal-modal').style = 'width: auto; max-width: 90%;'
// Resize modal
document.body.querySelector('.swal-overlay .swal-modal:not(.is-expanded)').classList.add('is-expanded')
})
}
@ -581,6 +581,9 @@ page.displayThumbnail = function (id) {
}).then(function () {
const video = div.querySelector('#swalVideo')
if (video) { video.remove() }
// Restore modal size
document.body.querySelector('.swal-overlay .swal-modal.is-expanded').classList.remove('is-expanded')
})
}

View File

@ -15,7 +15,7 @@
v2: Images and config files (manifest.json, browserconfig.xml, etc).
v3: CSS and JS files (libs such as bulma, lazyload, etc).
#}
{% set v1 = "PuOkOUW8DU" %}
{% set v1 = "pOlCxn3xNn" %}
{% set v2 = "Ii3JYKIhb0" %}
{% set v3 = "6MfcbDZldp" %}