diff --git a/scripts/uiTabsKeyboard.js b/scripts/uiTabsKeyboard.js --- a/scripts/uiTabsKeyboard.js +++ b/scripts/uiTabsKeyboard.js @@ -1,5 +1,5 @@ -/* - * Copyright 2010 Nathan Gelderloos, Ethan Zonca, Nathan Phillip Brink +/* -*- tab-width: 4; -*- + * Copyright 2012 Nathan Gelderloos, Ethan Zonca, Nathan Phillip Brink * * This file is part of SlatePermutate. * @@ -18,6 +18,8 @@ */ jQuery(document).ready( function() { + var share_facebook_a_obj = jQuery('#share-fb-a'); + var share_url_em_obj = jQuery('#share-url-em'); jQuery(document).keydown(function(e) { @@ -45,4 +47,20 @@ jQuery(document).ready( function() { } } }); + + function share_update_uris(hash) + { + share_facebook_a_obj.attr('href', share_facebook_template + hash.replace('#', '%23')); + share_url_em_obj.text(share_url_template + hash); + } + share_update_uris(window.location.hash); + + jQuery('#tabs').bind('tabsselect', function(event, ui) { + window.location.hash = ui.tab.hash; + /* + * Update some links to be specific to the current bug (bug + * #92). + */ + share_update_uris(ui.tab.hash); + }); });