Sha256: 1e98fb70a24f40115c87bd7ca07c4e9cf9b8abd325e5ab0e171a6d27e58f4624

Contents?: true

Size: 1.23 KB

Versions: 23

Compression:

Stored size: 1.23 KB

Contents

define([
    'backbone',
    'backbone-mediator'
],
function(
    Backbone
){

    var IndexRouter = Backbone.Router.extend({

        initialize : function(options) {
            this.app = options.app;
        },

        routes : {
            ''                       : 'ecosystem',
            'ecosystem'              : 'ecosystem',
            'dash/:id'               : 'dashboard', // dashboard id
            'dash/:id/expand/:mid'   : 'dashboard', // dashboard id & monitor id
            'dash/:id/category/:cid' : 'category'  // dashboard id & child dashboard id
        },

        category : function(id, cid) {
            // make sure we capture an integer value
            id  = ( id ) ? parseInt(id) : id;
            cid = ( cid ) ? parseInt(cid) : cid;

            if (id) this.app.category(id, cid);
        },

        dashboard : function(id, mid) {
            // make sure we capture an integer value
            id  = ( id ) ? parseInt(id) : id;
            mid = ( mid ) ? parseInt(mid) : mid;

            if (id) this.app.dashboard(id, mid);
        },

        ecosystem : function() {
            this.navigate('ecosystem', { replace : true });

            this.app.ecosystem();
        }
    });

    return IndexRouter;
});

Version data entries

23 entries across 23 versions & 1 rubygems

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