File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ class Pattern extends BasePattern {
7272 if ( base_url !== href_parts [ 0 ] || ! href_parts [ 1 ] ) {
7373 return ;
7474 }
75- if ( ! this . $el . has ( "#" + href_parts [ 1 ] ) . length ) {
75+ if ( ! this . $el . has ( `# ${ href_parts [ 1 ] } ` ) . length ) {
7676 return ;
7777 }
7878 e . preventDefault ( ) ;
@@ -89,20 +89,20 @@ class Pattern extends BasePattern {
8989 _updateAnchors ( selected ) {
9090 const $sheets = this . $el . find ( this . options . selector ) ;
9191 const base_url = this . _base_URL ( ) ;
92- $sheets . each ( function ( idx , sheet ) {
92+ for ( const sheet of $sheets ) {
9393 // This may appear odd, but: when querying a browser uses the
9494 // original href of an anchor as it appeared in the document
9595 // source, but when you access the href property you always get
9696 // the fully qualified version.
97- var $anchors = $ (
98- ' a[href="' + base_url + "#" + sheet . id + ' "],a[href="#' + sheet . id + '"]'
97+ const $anchors = $ (
98+ ` a[href="${ base_url } # ${ sheet . id } "], a[href="#${ sheet . id } "]`
9999 ) ;
100100 if ( sheet . id === selected ) {
101101 $anchors . addClass ( "current" ) ;
102102 } else {
103103 $anchors . removeClass ( "current" ) ;
104104 }
105- } ) ;
105+ }
106106 }
107107
108108 _switch ( sheet_id ) {
You can’t perform that action at this time.
0 commit comments