image: allow overriding css background-image when value is empty (#521)

This commit is contained in:
jean-emmanuel 2019-04-25 09:20:01 +02:00
parent 16d3febac4
commit 487dc6afd9
2 changed files with 7 additions and 1 deletions

View file

@ -4,6 +4,7 @@
- bug fixes:
- modal: `css` not properly applied if the property was previously empty and the modal had been opened at least once
- image: allow overriding css background-image when value is empty
## 0.45.7

View file

@ -79,7 +79,12 @@ module.exports = class Image extends Widget {
if (!parser.protocol.match(/http|data/)) url = url.replace(':', '_:_')
url = url.replace(/\\/g, '\\\\')
this.widget.style.setProperty('background-image', `url("${url}${cache_query}")`)
if (url) {
this.widget.style.setProperty('background-image', `url("${url}${cache_query}")`)
} else {
this.widget.style.setProperty('background-image', '')
}
if (options.sync) this.changed(options)