Skip to content

Commit

Permalink
check for empty file, do not display
Browse files Browse the repository at this point in the history
  • Loading branch information
Shoshana Berleant committed Jan 17, 2016
1 parent 2ef32aa commit 4898d61
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,23 @@ module.exports = function (el, link) {

browser.on('entry', function (entry) {
if (entry.type === 'file') {
var file = {
name: entry.path,
length: entry.size,
createReadStream: function (opts) {
return feed.getFile(entry.data).createStream(opts)
if (entry.size !== 0) {
var file = {
name: entry.path,
length: entry.size,
createReadStream: function (opts) {
return feed.getFile(entry.data).createStream(opts)
}
}
clearMedia()
data.render(file, $display, function (err, elem) {
if (err) throw err
$display.style.display = 'block'
$overlay.style.display = 'block'
elem.onclick = clearMedia
$display.style['background-color'] = elem.tagName === 'IFRAME' ? 'white' : 'black'
})
}
clearMedia()
data.render(file, $display, function (err, elem) {
if (err) throw err
$display.style.display = 'block'
$overlay.style.display = 'block'
elem.onclick = clearMedia
$display.style['background-color'] = elem.tagName === 'IFRAME' ? 'white' : 'black'
})
}
})
})
Expand Down

0 comments on commit 4898d61

Please sign in to comment.