Sha256: 53f03257f55178f71592d9cd3dfb81394493070a29bbf08e1ac59f3cbb5a99b4
Contents?: true
Size: 1.35 KB
Versions: 7
Compression:
Stored size: 1.35 KB
Contents
# Collection Loader View is a simple modal view # You can provide your own template for the collection loader modal # if you want to. Default implementation uses twitter bootstrap modal and # progress bar (http://twitter.github.com/bootstrap/). You template # should contain `progress`, `bar` and `message` classes _.def('Luca.components.CollectionLoaderView').extends('Luca.components.Template').with className: 'luca-ui-collection-loader-view' template: "components/collection_loader_view" initialize: (@options={})-> Luca.components.Template::initialize.apply @,arguments @container ||= $('body') @manager ||= Luca.CollectionManager.get() @setupBindings() modalContainer: ()-> $("#progress-modal", @el) setupBindings: ()-> @manager.bind "collection_loaded", (name)=> loaded = @manager.loadedCollectionsCount() total = @manager.totalCollectionsCount() progress = parseInt((loaded / total) * 100) collectionName = _.string.titleize( _.string.humanize( name ) ) @modalContainer().find('.progress .bar').attr("style", "width: #{progress}%;") @modalContainer().find('.message').html("Loaded #{ collectionName }...") @manager.bind "all_collections_loaded", ()=> @modalContainer().find('.message').html("All done!") _.delay ()=> @modalContainer().modal('hide') , 400
Version data entries
7 entries across 7 versions & 1 rubygems