Skip to content

Instantly share code, notes, and snippets.

@dbouwman
Created February 20, 2013 04:38
Show Gist options
  • Save dbouwman/4992923 to your computer and use it in GitHub Desktop.
Save dbouwman/4992923 to your computer and use it in GitHub Desktop.
Empty Module and Controller
/*global gmm */
if (!this.gmm || typeof this.gmm !== 'object') {
this.gmm = {};
}
(function () {
'use strict';
gmm.Viewer.module('NavbarModule', function (Mod, Viewer, Backbone, Marionette, $, _) {
//==================================
//initializer called on Viewer.start(options)
//==================================
Mod.addInitializer(function (options) {
Mod.controller = new Controller({
toolItems: options.toolItems,
//we pass in the region from the app because it will be
//converted into a Marionette.Region for us
region: Viewer.toolsRegion
});
});
//==================================
//Controller for the NavbarModule
//==================================
var Controller = Backbone.Marionette.Controller.extend({
initialize: function (options) {
_.bindAll();
this.region = options.region;
});
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment