mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUG Fix rewriteHashlinks in TabSet
As per commit 3478813, check for presence of href before matching
This commit is contained in:
parent
34788130ef
commit
1a4b245e84
@ -24,6 +24,8 @@
|
|||||||
*/
|
*/
|
||||||
rewriteHashlinks: function() {
|
rewriteHashlinks: function() {
|
||||||
$(this).find('ul a').each(function() {
|
$(this).find('ul a').each(function() {
|
||||||
|
if (!$(this).attr('href')) return;
|
||||||
|
|
||||||
var matches = $(this).attr('href').match(/#.*/);
|
var matches = $(this).attr('href').match(/#.*/);
|
||||||
if(!matches) return;
|
if(!matches) return;
|
||||||
$(this).attr('href', document.location.href.replace(/#.*/, '') + matches[0]);
|
$(this).attr('href', document.location.href.replace(/#.*/, '') + matches[0]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user