Skip to content

Instantly share code, notes, and snippets.

@chrismytton
Created February 11, 2013 23:11
Show Gist options
  • Save chrismytton/4758491 to your computer and use it in GitHub Desktop.
Save chrismytton/4758491 to your computer and use it in GitHub Desktop.
Ember.js progress bar component for bootstrap. Simplified version of https://github.com/jamesarosen/progressbars
App.ProgressBar = Ember.View.extend
classNames: ['progress']
template: -> '<div class="bar"></div>'
percent: 0
percentDidChange: (->
percent = @get 'percent' || 0
@$('.bar').css 'width', percent + '%'
).observes('percent')
{{#each file in controller}}
{{view App.ProgressBar percentBinding="file.percentDownloaded"}}
{{/each}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment