Skip to content

Commit

Permalink
костыль для Pale Moon
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcom committed Jan 9, 2025
1 parent 0421e6a commit ee5acad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/main/webapp/WEB-INF/tags/image.tag
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<c:set var="heightLimitValue" value="${(empty heightLimit) ? '90vh' : heightLimit}" />

<c:if test="${showImage!=null and showImage and image!=null}">
<%-- width продублирован Pale Moon и других для браузеров, не умеющих min() --%>
<div class="medium-image-container" style="max-width: <%= Math.min(image.getFullInfo().getWidth(), Image.MaxScaledSize()) %>px; max-height: ${heightLimitValue};
width: var(--image-width); width: min(var(--image-width), calc(${heightLimitValue} * ${image.mediumInfo.width} / ${image.mediumInfo.height}))">
<figure class="medium-image" <%-- padding продублирован Pale Moon и других для браузеров, не умеющих min() --%>
Expand Down
3 changes: 1 addition & 2 deletions src/main/webapp/WEB-INF/tags/imageslider.tag
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
<%@ attribute name="additional" required="true" type="java.util.List<ru.org.linux.topic.PreparedImage>" %>
<%@ attribute name="heightLimit" required="false" type="java.lang.String" %>
<c:set var="heightLimitValue" value="${(empty heightLimit) ? '90vh' : heightLimit}" />
<%-- width продублирован Pale Moon и других для браузеров, не умеющих min() --%>
<div class="slider-parent" style="width: var(--image-width); width: min(var(--image-width), calc(${heightLimitValue} * ${main.mediumInfo.width} / ${main.mediumInfo.height}))">
<div class="slider-parent" style="width: min(var(--image-width), calc(${heightLimitValue} * ${main.mediumInfo.width} / ${main.mediumInfo.height}))">
<div class="swiffy-slider slider-indicators-round ${classes} slider-item-ratio slider-item-ratio-contain"
style="--swiffy-slider-item-ratio: ${main.fullInfo.width}/${main.fullInfo.height}">
<div class="slider-container">
Expand Down
12 changes: 12 additions & 0 deletions src/main/webapp/js/lor.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,18 @@ $(document).ready(function() {
initCodeSpoilers();
initReactionsUI();

// fix images on Pale Moon
$('.medium-image-container').each(function() {
if ($(this).width() == 0) {
$(this).css('width', 'var(--image-width)')
}
});
$('.slider-parent').each(function() {
if ($(this).height() <= 48) {
$(this).css('width', 'var(--image-width)')
}
});

$script.ready('plugins', function () {
if (window.matchMedia("(min-width: 70em)").matches) {
$(".msg_body .swiffy-slider").addClass("slider-nav-outside-expand").addClass("slider-nav-visible");
Expand Down

0 comments on commit ee5acad

Please sign in to comment.