Sha256: 3c16a8ecc82ac9d80c1b61959d125390171a4ff1e8ae2c9604c3dcf7264f2b77

Contents?: true

Size: 916 Bytes

Versions: 23

Compression:

Stored size: 916 Bytes

Contents

define(
[
    'jquery',
    'underscore',
    'backbone',
    'model/dashboard'
],
function(
    $,
    _,
    Backbone,
    DashboardModel
) {

    /**
     * DashboardCollection
     *
     * Route that pulls back all available dashboards.
     **/
    var DashboardCollection = Backbone.Collection.extend({
        model : DashboardModel,
        url   : '/dashboards.json',

        comparator : function(dashboard) {
            return dashboard.get('name').toLowerCase();
        },
        initialize : function(models, options) {
            if (options) this.cb = options.cb;
            
            this.fetch({
                success : function() {
                    if ( this.cb ) this.cb();
                    Backbone.Mediator.pub('collection:dashboard:init', this);
                }.bind(this),
                async : false
            });
        }
    });

    return DashboardCollection;
});

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rearview-1.2.3-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.2.2.rc.2-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.2.2.rc.1-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.2.1-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.2.0-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.1.2-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.1.1-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.1.0-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.0.3.rc.4-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.0.3.rc.3-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.0.3.rc.2-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.0.3.rc.1-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.0.2-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.0.2.rc.4-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.0.2.rc.3-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.0.2.rc.2-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.0.2.rc.1-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.0.1-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.0.0-jruby public/rearview-src/js/collection/dashboard.js
rearview-1.0.0.rc5-jruby public/rearview-src/js/collection/dashboard.js