Skip to content

Commit

Permalink
Merge pull request #44 from AlexKvazos/master
Browse files Browse the repository at this point in the history
Fix backgrounds and add ready api
  • Loading branch information
abuturla authored Mar 14, 2018
2 parents 8101125 + 5f374e6 commit b5cc1de
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/widget/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ function render() {
// Set background image if needed
if (design && design.backgroundImage) {
const DPR = window.devicePixelRatio;
const width = Math.ceil(state.width * DPR);
const height = Math.ceil(state.height * DPR);

const baseUrl = 'https://czi3m2qn.cloudimg.io/s/crop';
const cropUrl = `${baseUrl}/${state.width * DPR}x${state.height * DPR}`;
const cropUrl = `${baseUrl}/${width}x${height}`;
const url = `${cropUrl}/${design.backgroundImage}`;

window.document.body.setAttribute('style', `
Expand All @@ -90,6 +92,12 @@ function render() {

// Render HTML content
textContainer.innerHTML = content.text;

try {
buildfire.appearance.ready();
} catch (err) {
console.log('appearance.ready() failed, is sdk up to date?');
}
}


Expand Down

0 comments on commit b5cc1de

Please sign in to comment.