Skip to content
Snippets Groups Projects
Unverified Commit cde9de5e authored by Tom Robinson's avatar Tom Robinson Committed by GitHub
Browse files

Merge pull request #9423 from metabase/fix-dash-grid-bg-for-chrome-72

Fix dashboard grid background image for Chrome 72
parents 8b061789 11c69afc
No related branches found
No related tags found
No related merge requests found
...@@ -228,11 +228,12 @@ export default class GridLayout extends Component { ...@@ -228,11 +228,12 @@ export default class GridLayout extends Component {
} }
} }
// generate one row of the grid, it will repeat because it's a background image
getGridBackground() { getGridBackground() {
let { margin, cols } = this.props; const { margin, cols } = this.props;
let cellSize = this.getCellSize(); const cellSize = this.getCellSize();
return ( const svg =
`url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='${cellSize.width * `<svg xmlns='http://www.w3.org/2000/svg' width='${cellSize.width *
cols}' height='${cellSize.height}'>` + cols}' height='${cellSize.height}'>` +
_(cols) _(cols)
.times( .times(
...@@ -246,8 +247,8 @@ export default class GridLayout extends Component { ...@@ -246,8 +247,8 @@ export default class GridLayout extends Component {
)}' height='${cellSize.height - margin - 3}'/>`, )}' height='${cellSize.height - margin - 3}'/>`,
) )
.join("") + .join("") +
`</svg>")` `</svg>`;
); return `url("data:image/svg+xml;utf8,${encodeURIComponent(svg)}")`;
} }
render() { render() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment