Skip to content

Instantly share code, notes, and snippets.

@thirdender
Created January 5, 2012 20:54
Show Gist options
  • Save thirdender/1567235 to your computer and use it in GitHub Desktop.
Save thirdender/1567235 to your computer and use it in GitHub Desktop.
Extend a Cargo CMS specific Javascript function
var openThisPrInline = (function() {
// Store the existing function
var oldFunction = window.openThisPrInline;
// Return a new function
return function(data) {
// Run the old code
oldFunction(data);
// Start jScrollPane if #section-scroll exists
if (document.getElementById("section-scroll")) {
jQuery('#section-scroll').jScrollPane();
}
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment