Skip to content

Instantly share code, notes, and snippets.

@jrochkind
Created March 25, 2010 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrochkind/344083 to your computer and use it in GitHub Desktop.
Save jrochkind/344083 to your computer and use it in GitHub Desktop.
$(".more_facets_link a").each(function() {
//We use each to let us make a Dialog object for each
//a, tied to that a, through the miracle of closures. the second
// arg to 'bind' is used to make sure the event handler gets it's
// own dialog.
var more_facets_dialog = $("<div></div>").dialog({ autoOpen: false });
$(this).bind("click", {dialog: more_facets_dialog}, function( event ) {
// Load the original URL on the link into the dialog associated
// with it.
// Rails app will give us an appropriate partial.
event.data.dialog.load( this.href );
// position it well (TO DO), 'open' it, and send it to front.
event.data.dialog.dialog("open").dialog("moveToTop");
return false; // do not execute default href visit
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment