improve background image url string

This commit is contained in:
zombieFox 2021-09-19 20:20:48 +01:00
parent 74c02bb4fb
commit 43499ede04
2 changed files with 3 additions and 3 deletions

View File

@ -309,7 +309,7 @@ const BookmarkTile = function({
this.element.bookmark.style.setProperty('--bookmark-display-visual-size', bookmarkData.link.display.visual.size);
this.element.bookmark.style.setProperty('--bookmark-display-visual-image-url', 'url(' + trimString(bookmarkData.link.display.visual.image.url) + ')');
this.element.bookmark.style.setProperty('--bookmark-display-visual-image-url', 'url("' + trimString(bookmarkData.link.display.visual.image.url) + '")');
this.element.bookmark.style.setProperty('--bookmark-display-name-size', bookmarkData.link.display.name.size);
@ -413,7 +413,7 @@ const BookmarkTile = function({
switch (bookmarkData.link.background.type) {
case 'image':
if (isValidString(bookmarkData.link.background.image.url)) {
this.element.bookmark.style.setProperty('--bookmark-background-image-url', 'url(' + trimString(bookmarkData.link.background.image.url) + ')');
this.element.bookmark.style.setProperty('--bookmark-background-image-url', 'url("' + trimString(bookmarkData.link.background.image.url) + '")');
};
break;
};

View File

@ -398,7 +398,7 @@ theme.background.image = {
const allUrls = trimString(state.get.current().theme.background.image.url).split(/\s+/).filter((item) => { return item != ''; });
html.style.setProperty('--theme-background-image', 'url(' + allUrls[Math.floor(Math.random() * allUrls.length)] + ')');
html.style.setProperty('--theme-background-image', 'url("' + allUrls[Math.floor(Math.random() * allUrls.length)] + '")');
} else {