Skip to content

Instantly share code, notes, and snippets.

@dbouwman
Last active December 13, 2015 22:18
Show Gist options
  • Save dbouwman/4982959 to your computer and use it in GitHub Desktop.
Save dbouwman/4982959 to your computer and use it in GitHub Desktop.
Simple Marionette Application with a global event debugger
/*global gmm */
if (!this.gmm || typeof this.gmm !== 'object') {
this.gmm = {};
}
(function () {
'use strict';
gmm.Viewer = new Backbone.Marionette.Application();
gmm.Viewer.addRegions({
toolsRegion: '#tool-list-region'
});
//debugging so we can see events flying around
gmm.Viewer.vent.on('all', function (evt, model) {
console.log('gmm.Viewer DEBUG: Event Caught: ' + evt);
if (model) {
console.dir(model);
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment