Skip to content

Commit

Permalink
update upload panel img prop
Browse files Browse the repository at this point in the history
avoid issues when $pattern is not correctly set in the view
  • Loading branch information
ctf0 authored Feb 9, 2019
1 parent 4d2be1a commit 93846c9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/resources/assets/js/modules/computed.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,12 @@ export default {
let imgs = this.uploadPanelImgList
let grds = this.uploadPanelGradients

let url = imgs[Math.floor(Math.random() * imgs.length)]
let url = imgs.length ? imgs[Math.floor(Math.random() * imgs.length)] : null
let color = grds[Math.floor(Math.random() * grds.length)]

return {
'--gradient': color,
'background-image': `url("${url}")`
}

return url
? {'--gradient': color, 'background-image': `url("${url}")`}
: {'--gradient': color}
}
},

Expand Down

0 comments on commit 93846c9

Please sign in to comment.