Skip to content

Instantly share code, notes, and snippets.

@kaievns
Created November 26, 2009 10:28
Show Gist options
  • Save kaievns/243381 to your computer and use it in GitHub Desktop.
Save kaievns/243381 to your computer and use it in GitHub Desktop.
shared behavior in RightJS
var parent_removal_behavior = {
click: function() {
this.parent().hide();
}
};
// assigning to css-rules
".remove_parent".behave(parent_removal_behavior);
".some_other_rule".behave(parent_removal_behavior);
// assigning to some specific element directly
$('specific-element').on(parent_removal_behavior);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment