Skip to content

Instantly share code, notes, and snippets.

@mateusz
Created May 30, 2012 22:16
Show Gist options
  • Save mateusz/2839279 to your computer and use it in GitHub Desktop.
Save mateusz/2839279 to your computer and use it in GitHub Desktop.
(function($) {
$('.cms-container').entwine({
Handler: null,
onmatch: function() {
var self = this;
var handler = function(e) {
var closure = self;
alert($(closure).attr('id'));
};
$(window).bind('load', handler);
this.setHandler(handler);
this._super();
},
onunmatch: function() {
// should I unbind here?
// If yes, how do I make it specific to this node/context
// without setting the closure function as an entwine property?
$(window).unbind('load', this.getHandler());
this._super();
}
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment