Skip to content

Instantly share code, notes, and snippets.

@jonlow
Last active September 17, 2015 06:11
Show Gist options
  • Save jonlow/213355be6674ffc1f457 to your computer and use it in GitHub Desktop.
Save jonlow/213355be6674ffc1f457 to your computer and use it in GitHub Desktop.
SUPER an existing javascript function.
// Existing function is T2.page.popup.open(number)
T2.page.popup.open = (function(_super) {
return function(popupNumber) {
// 1. Add in your custom code here
// e.g someting.completePage()
// 2. Then this line executes the old code
return _super.apply(this,[popupNumber]);
};
})(T2.page.popup.open);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment