mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
fix lightbox (again)
This commit is contained in:
parent
bd3da38ff9
commit
0623b445e6
3 changed files with 12 additions and 38 deletions
|
@ -86,6 +86,9 @@ function setupLightboxGallery() {
|
|||
|
||||
|
||||
function setupLightboxTeaser() {
|
||||
function popStateListener(event) {
|
||||
baguetteBox.hide();
|
||||
}
|
||||
baguetteBox.run('.post_teaser', {
|
||||
fullScreen: false,
|
||||
noScrollbars: true,
|
||||
|
@ -93,18 +96,7 @@ function setupLightboxTeaser() {
|
|||
preload: 3,
|
||||
ignoreClass: 'preview_image',
|
||||
afterShow: function() {
|
||||
var backButtonPrevented = false;
|
||||
history.pushState(null, document.title, location.href);
|
||||
function popStateListener(event) {
|
||||
if (backButtonPrevented === false){
|
||||
history.pushState(null, document.title, location.href);
|
||||
baguetteBox.hide();
|
||||
backButtonPrevented = true;
|
||||
} else {
|
||||
window.removeEventListener('popstate', popStateListener);
|
||||
history.back();
|
||||
}
|
||||
}
|
||||
window.history.pushState('#lightbox', document.title, document.location+'#lightbox');
|
||||
window.addEventListener('popstate', popStateListener);
|
||||
|
||||
function baguetteBoxClickImg(event) {
|
||||
|
@ -122,6 +114,12 @@ function setupLightboxTeaser() {
|
|||
el.addEventListener('click', baguetteBoxClickImg);
|
||||
}
|
||||
},
|
||||
afterHide: function() {
|
||||
if (window.history.state === '#lightbox') {
|
||||
window.history.back();
|
||||
window.removeEventListener('popstate', popStateListener);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1428,19 +1428,7 @@ h1 .warning_badge {
|
|||
}
|
||||
|
||||
#baguetteBox-overlay {
|
||||
overflow: scroll !important;
|
||||
}
|
||||
|
||||
#baguetteBox-overlay .full-image {
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
#baguetteBox-overlay .full-image figure {
|
||||
display: inline-block !important;
|
||||
}
|
||||
|
||||
#baguetteBox-slider {
|
||||
height: auto !important;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=structure.css.map */
|
||||
|
|
|
@ -1106,17 +1106,5 @@ h1 .warning_badge {
|
|||
}
|
||||
|
||||
#baguetteBox-overlay {
|
||||
overflow: scroll !important;
|
||||
.full-image {
|
||||
height: auto !important;
|
||||
//min-height: 100%;
|
||||
figure {
|
||||
display: inline-block !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#baguetteBox-slider {
|
||||
height: auto !important;
|
||||
//min-height: 100%;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue