mirror of
https://github.com/StarCitizenTools/mediawiki-extensions-TabberNeue.git
synced 2024-11-27 17:50:55 +00:00
refactor: CSS.escape may not be supported by some browsers
This commit is contained in:
parent
98c6f2753a
commit
f1aee0bdf6
|
@ -196,7 +196,8 @@ function initTabber( tabber, count ) {
|
|||
var targetHash = new mw.Uri( location.href ).fragment;
|
||||
|
||||
// Switch to the first tab if no targetHash or no tab is detected
|
||||
if ( !targetHash || !tabList.querySelector( '#tab-' + CSS.escape( targetHash ) ) ) {
|
||||
// TODO: Remove the polyfill with CSS.escape when we are dropping IE support
|
||||
if ( !targetHash || !tabList.querySelector( '#tab-' + targetHash.replace( /[^a-zA-Z0-9-_]/g, '\\$&' ) ) ) {
|
||||
targetHash = tabList.firstElementChild.getAttribute( 'id' ).substring( 4 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue