@@ -49,8 +49,12 @@ const AjaxLoad = (($) => {
49
49
this . _element = element
50
50
51
51
const url = location . hash . replace ( / ^ # / , '' )
52
- // eslint-disable-next-line no-unused-expressions
53
- url !== '' ? this . setUpUrl ( url ) : this . setUpUrl ( this . _config . defaultPage )
52
+
53
+ if ( url !== '' ) {
54
+ this . setUpUrl ( url )
55
+ } else {
56
+ this . setUpUrl ( this . _config . defaultPage )
57
+ }
54
58
this . _addEventListeners ( )
55
59
}
56
60
@@ -77,10 +81,6 @@ const AjaxLoad = (($) => {
77
81
cache : false ,
78
82
async : false ,
79
83
success : function success ( ) {
80
- if ( typeof Pace !== 'undefined' ) {
81
- // eslint-disable-next-line no-undef
82
- Pace . restart ( )
83
- }
84
84
$ ( 'body' ) . animate ( {
85
85
scrollTop : 0
86
86
} , 0 )
@@ -97,10 +97,9 @@ const AjaxLoad = (($) => {
97
97
setUpUrl ( url ) {
98
98
$ ( Selector . NAV_LINK ) . removeClass ( ClassName . ACTIVE )
99
99
$ ( Selector . NAV_DROPDOWN ) . removeClass ( ClassName . OPEN )
100
- // eslint-disable-next-line prefer-template
101
- $ ( Selector . NAV_DROPDOWN + ':has(a[href="' + url . replace ( / ^ \/ / , '' ) . split ( '?' ) [ 0 ] + '"])' ) . addClass ( ClassName . OPEN )
102
- // eslint-disable-next-line prefer-template
103
- $ ( Selector . NAV_ITEM + ' a[href="' + url . replace ( / ^ \/ / , '' ) . split ( '?' ) [ 0 ] + '"]' ) . addClass ( ClassName . ACTIVE )
100
+
101
+ $ ( `${ Selector . NAV_DROPDOWN } :has(a[href="${ url . replace ( / ^ \/ / , '' ) . split ( '?' ) [ 0 ] } "])` ) . addClass ( ClassName . OPEN )
102
+ $ ( `${ Selector . NAV_ITEM } a[href="${ url . replace ( / ^ \/ / , '' ) . split ( '?' ) [ 0 ] } "]` ) . addClass ( ClassName . ACTIVE )
104
103
105
104
this . loadPage ( url )
106
105
}
@@ -124,8 +123,7 @@ const AjaxLoad = (($) => {
124
123
}
125
124
126
125
_addEventListeners ( ) {
127
- // eslint-disable-next-line prefer-template
128
- $ ( document ) . on ( Event . CLICK , Selector . NAV_LINK + '[href!="#"]' , ( event ) => {
126
+ $ ( document ) . on ( Event . CLICK , `${ Selector . NAV_LINK } [href!="#"]` , ( event ) => {
129
127
event . preventDefault ( )
130
128
event . stopPropagation ( )
131
129
0 commit comments