Skip to content

Instantly share code, notes, and snippets.

@gcr
Created January 15, 2009 03:14
Show Gist options
  • Save gcr/47246 to your computer and use it in GitHub Desktop.
Save gcr/47246 to your computer and use it in GitHub Desktop.
function gbDocument(docname) {
/* ..... */
this.destroy = function() {
// We've been destroyed! Best clean up our actions.
pagehandler.removeDoc(this.name, $(".tablist"));
console.log("I'm being deleted!");
console.log(this);
return undefined
}
}
/* To be used like: */
session.documents['document name here'] = new gbDocument('document name here');
/* Then I'd use that document, when it's not needed: */
session.documents['document name here'] = session.documents['document name here'].destroy();
// Doesn't delete this, just sets it to undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment