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:
commit
2bc516acf4
2 changed files with 21 additions and 1 deletions
20
app/javascript/controllers/fix_table_border_controller.ts
Normal file
20
app/javascript/controllers/fix_table_border_controller.ts
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -31,7 +31,7 @@
|
||||||
= yield(:invisible_captcha_styles)
|
= yield(:invisible_captcha_styles)
|
||||||
= render partial: 'layouts/setup_theme'
|
= 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/skiplinks'
|
||||||
= render partial: 'layouts/display_theme_modal'
|
= render partial: 'layouts/display_theme_modal'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue