Skip to content

Commit

Permalink
Merge pull request #43 from AlexKvazos/master
Browse files Browse the repository at this point in the history
Fix background image
  • Loading branch information
abuturla authored Mar 7, 2018
2 parents 184dbf9 + 73bf3bf commit 8101125
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/widget/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
<script src="../../../scripts/buildfire/components/carouselLight/carouselLight.min.js"></script>
<style>
body {
background-position: center;
background-size: cover;
background-attachment: fixed;
margin: 0;
}
img {
Expand All @@ -25,7 +22,7 @@
}
</style>
</head>
<body>
<body style="">
<div>
<div id="carousel"></div>
<div id="text" class="padded"></div>
Expand Down
7 changes: 6 additions & 1 deletion src/widget/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ function render() {
const cropUrl = `${baseUrl}/${state.width * DPR}x${state.height * DPR}`;
const url = `${cropUrl}/${design.backgroundImage}`;

window.document.body.style.backgroundImage = `url(${url})`;
window.document.body.setAttribute('style', `
background-position: center !important;
background-size: cover !important;
background-attachment: fixed !important;
background-image: url(${url}) !important;
`);
} else {
window.document.body.style.backgroundImage = '';
}
Expand Down

0 comments on commit 8101125

Please sign in to comment.