Merge pull request #11085 from mfo/US/fix-border-size-offset

ETQ instructeur, je souhaite avoir des bordures sur mon tableau d'instructeur qu'importe le niveau de zoom
This commit is contained in:
mfo 2024-11-26 08:55:30 +00:00 committed by GitHub
commit 2bc516acf4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 1 deletions

View file

@ -0,0 +1,20 @@
import { ApplicationController } from './application_controller';
export class FixTableBorderController extends ApplicationController {
connect() {
const pixelSize = Math.round((1 / window.devicePixelRatio) * 100) / 100;
// Safari does not support devicePixelRatio
if (navigator.userAgent.indexOf('Safari') > -1) {
return;
}
const fix = document.createElement('style');
fix.innerText = `
.fr-table.fr-table--bordered .fr-table__content th,
.fr-table.fr-table--bordered .fr-table__content td {
background-size: 100% ${pixelSize}px, ${pixelSize}px 100%}
}`;
document.body.appendChild(fix);
}
}

View file

@ -31,7 +31,7 @@
= yield(:invisible_captcha_styles)
= render partial: 'layouts/setup_theme'
%body{ { id: content_for(:page_id), class: browser.platform.ios? ? 'ios' : nil, data: { controller: 'turbo number-input' } }.compact }
%body{ { id: content_for(:page_id), class: browser.platform.ios? ? 'ios' : nil, data: { controller: 'turbo number-input fix-table-border' } }.compact }
= render partial: 'layouts/skiplinks'
= render partial: 'layouts/display_theme_modal'