Merge pull request #995 from nyeholt/tab_hashlink_bug

BUG Rewrite hashlinks failing on empty a tags
This commit is contained in:
Ingo Schommer 2012-12-04 00:50:10 -08:00
commit 4a0099e049
2 changed files with 3 additions and 0 deletions

View File

@ -951,6 +951,7 @@ jQuery.noConflict();
*/
rewriteHashlinks: function() {
$(this).find('ul a').each(function() {
if (!$(this).attr('href')) return;
var matches = $(this).attr('href').match(/#.*/);
if(!matches) return;
$(this).attr('href', document.location.href.replace(/#.*/, '') + matches[0]);

View File

@ -24,6 +24,8 @@
*/
rewriteHashlinks: function() {
$(this).find('ul a').each(function() {
if (!$(this).attr('href')) return;
var matches = $(this).attr('href').match(/#.*/);
if(!matches) return;
$(this).attr('href', document.location.href.replace(/#.*/, '') + matches[0]);