image: allow overriding css background-image when value is empty (#521)
This commit is contained in:
parent
16d3febac4
commit
487dc6afd9
2 changed files with 7 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue