Permalink
Browse files

fix progress bar

  • Loading branch information...
1 parent 07013a1 commit de465f37d4cd35a8a4879c2caefc8994730f3bad @feross committed Mar 3, 2014
Showing with 5 additions and 4 deletions.
  1. +2 −2 css/main.styl
  2. +3 −2 lib/storage.js
View
@@ -168,15 +168,15 @@ progress::-webkit-progress-bar
background-color: NO_METADATA_COLOR
.torrent.has-metadata
- progress[value="100"]::-webkit-progress-bar
+ progress[value="1"]::-webkit-progress-bar
background-color: SEED_COLOR
progress::-webkit-progress-value
position: relative
background-size: 40px 15px, 100% 100%, 100% 100%
border-radius: 3px
- progress:not([value="100"])::-webkit-progress-value
+ progress:not([value="1"])::-webkit-progress-value
animation: animate-stripes 2s linear infinite
background-image: linear-gradient(135deg, transparent, transparent 33%, rgba(0, 0, 0, 0.1) 33%, rgba(0, 0, 0, 0.1) 66%, transparent 66%),
linear-gradient(top, rgba(255, 255, 255, .25), rgba(0, 0, 0, 0.2)),
View
@@ -220,9 +220,9 @@ Object.defineProperty(Storage.prototype, 'progress', {
Object.defineProperty(Storage.prototype, 'numMissing', {
get: function () {
var self = this
- var numMissing = 0
+ var numMissing = self.pieces.length
for (var index = 0, len = self.pieces.length; index < len; index++) {
- numMissing += (self.bitfield.get(index) === 0)
+ numMissing -= self.bitfield.get(index)
}
return numMissing
}
@@ -262,6 +262,7 @@ Storage.prototype.deselectBlock = function (index, offset) {
Storage.prototype._onPieceDone = function (piece) {
var self = this
+ console.log('PIECE DONE', self.progress, self.numMissing)
self.bitfield.set(piece.index)
self.emit('piece', piece)
}

0 comments on commit de465f3

Please sign in to comment.