Created
March 25, 2010 20:59
-
-
Save jrochkind/344110 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".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 = "empty"; | |
$(this).click( function() { | |
//lazy create of dialog | |
if ( more_facets_dialog == "empty") { | |
more_facets_dialog = $("<div></div>").dialog({ autoOpen: false }) | |
} | |
// Load the original URL on the link into the dialog associated | |
// with it. | |
// Rails app will give us an appropriate partial. | |
more_facets_dialog.load( this.href ); | |
// position it well (TO DO), 'open' it, and send it to front. | |
more_facets_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