Skip to content

Instantly share code, notes, and snippets.

@fixlr
Created December 30, 2010 14:24
Show Gist options
  • Save fixlr/759836 to your computer and use it in GitHub Desktop.
Save fixlr/759836 to your computer and use it in GitHub Desktop.
Pseudo-code example of something I'm working on
$('.button.dialog').click(function() {
$('#dialog').load(this.href, function() {
$('#dialog .close').click(function() {
$('#dialog').hide().html('');
return false;
});
$(document).keyup(function(e) {
if (e.keyCode == 27) { $('#dialog .close').click(); } // esc
});
$(this).show();
});
return false;
});
$('.button.save').click(function() {
// submit the form and #dialog.hide() if it exists
// (how to tell what form?)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment