mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #995 from nyeholt/tab_hashlink_bug
BUG Rewrite hashlinks failing on empty a tags
This commit is contained in:
commit
4a0099e049
@ -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]);
|
||||
|
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user