This commit is contained in:
Feross Aboukhadijeh
2016-03-03 16:48:13 -08:00
parent 1c685b3de6
commit 6ee263b8e3

View File

@@ -4,7 +4,10 @@ var h = require('virtual-dom/h')
var prettyBytes = require('pretty-bytes') var prettyBytes = require('pretty-bytes')
function TorrentList (state, dispatch) { function TorrentList (state, dispatch) {
var list = state.view.client.torrents.map(function (torrent) { return h('.torrent-list', getList())
function getList () {
return state.view.client.torrents.map(function (torrent) {
var style = {} var style = {}
if (torrent.posterURL) { if (torrent.posterURL) {
style['background-image'] = 'linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%), url("' + torrent.posterURL + '")' style['background-image'] = 'linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%), url("' + torrent.posterURL + '")'
@@ -60,5 +63,5 @@ function TorrentList (state, dispatch) {
dispatch('openAirplay', torrent) dispatch('openAirplay', torrent)
} }
}) })
return h('.torrent-list', list) }
} }