Created
November 9, 2011 15:39
-
-
Save zackham/1351818 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// allow setting / triggering of events for all instances | |
_.extend(SG, Backbone.Events); | |
_.extend(SG.prototype, Backbone.Events, { | |
// allow binding to events triggered from any instance | |
// used for hooking into initialize:after by plugins | |
setupGlobalEvents: function() { | |
this.bind('all', function() { | |
var argsWithoutEv = Array.prototype.slice.call(arguments, 1); | |
SG.trigger.apply(SG, [arguments[0], this].concat(argsWithoutEv)); | |
}, this); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment