@penskemediacorp/larva-js 1.19.0 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/video-showcase.js +7 -7
- package/package.json +2 -2
- package/src/__tests__/fixtures/markup.js +1 -1
- package/src/__tests__/utils/removeDesktopXlClasses.test.js +6 -4
- package/src/interface/Collapsible/Collapsible.js +31 -17
- package/src/interface/Collapsible/index.js +6 -2
- package/src/interface/EmailCapture/EmailCapture.js +17 -13
- package/src/interface/EmailCapture/index.js +6 -3
- package/src/interface/ExpandableSearch/ExpandableSearch.js +21 -21
- package/src/interface/ExpandableSearch/index.js +4 -4
- package/src/interface/Flickity/index.js +16 -11
- package/src/interface/MegaMenu/MegaMenu.js +22 -13
- package/src/interface/MegaMenu/index.js +12 -10
- package/src/interface/MobileHeightToggle/MobileHeightToggle.js +5 -4
- package/src/interface/MobileHeightToggle/MobileHeightToggle.test.js +22 -21
- package/src/interface/MobileHeightToggle/index.js +9 -8
- package/src/interface/Navigable/Navigable.js +29 -18
- package/src/interface/Navigable/index.js +1 -1
- package/src/interface/PopOver/PopOver.js +15 -15
- package/src/interface/PopOver/index.js +4 -4
- package/src/interface/ProfileFilter/ProfileFilter.js +40 -35
- package/src/interface/ProfileFilter/__test__/ProfileFilter.test.js +38 -31
- package/src/interface/ProfileFilter/index.js +2 -2
- package/src/interface/SelectNav/SelectNav.js +8 -6
- package/src/interface/SelectNav/index.js +2 -3
- package/src/interface/SideSkinAd/SideSkinAd.js +0 -2
- package/src/interface/SideSkinAd/index.js +10 -10
- package/src/interface/TabsManager/TabsManager.js +11 -6
- package/src/interface/TabsManager/index.js +1 -1
- package/src/interface/Tooltip/Tooltip.js +0 -1
- package/src/interface/VideoShowcase/VideoShowcase.js +77 -46
- package/src/interface/VideoShowcase/index.js +6 -2
- package/src/utils/ajaxIconSprite.js +4 -4
- package/src/utils/dom.js +6 -3
- package/src/utils/removeDesktopXlClasses.js +5 -7
- package/src/utils/webfontConfig.js +26 -40
package/src/utils/dom.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
export const matchesSelector = ( selector, el ) =>
|
|
1
|
+
export const matchesSelector = ( selector, el ) =>
|
|
2
|
+
el.matches && el.matches( selector );
|
|
2
3
|
|
|
3
4
|
export const delegateEvent = ( parent, event, selector, callback ) => {
|
|
4
|
-
parent.addEventListener( event, e => {
|
|
5
|
-
const matchingNode = matchesSelector( selector, e.target )
|
|
5
|
+
parent.addEventListener( event, ( e ) => {
|
|
6
|
+
const matchingNode = matchesSelector( selector, e.target )
|
|
7
|
+
? e.target
|
|
8
|
+
: e.target.closest( selector );
|
|
6
9
|
|
|
7
10
|
if ( matchingNode ) {
|
|
8
11
|
callback( e, matchingNode );
|
|
@@ -15,24 +15,22 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
export default function removeDesktopXlClasses() {
|
|
18
|
-
|
|
19
18
|
// Get all elements with desktop-xl styling
|
|
20
|
-
const desktopXlEls = [
|
|
19
|
+
const desktopXlEls = [
|
|
20
|
+
...document.querySelectorAll( '[class*="@desktop-xl"]' ),
|
|
21
|
+
];
|
|
21
22
|
|
|
22
23
|
// For each of these elements
|
|
23
24
|
// rebuild the className without the @desktop-xl classes
|
|
24
25
|
desktopXlEls.forEach( ( el ) => {
|
|
25
|
-
|
|
26
|
-
let classes = el.className.split( ' ' );
|
|
26
|
+
const classes = el.className.split( ' ' );
|
|
27
27
|
|
|
28
28
|
el.className = '';
|
|
29
29
|
|
|
30
30
|
classes.map( ( c ) => {
|
|
31
31
|
if ( ! c.includes( '@desktop-xl' ) ) {
|
|
32
|
-
el.className += ` ${c}`;
|
|
32
|
+
el.className += ` ${ c }`;
|
|
33
33
|
}
|
|
34
34
|
} );
|
|
35
|
-
|
|
36
35
|
} );
|
|
37
|
-
|
|
38
36
|
}
|
|
@@ -2,66 +2,52 @@
|
|
|
2
2
|
// post launch task from GUT-67 is to pull the
|
|
3
3
|
// IW related values into configuration
|
|
4
4
|
const webFontConfig = {
|
|
5
|
-
|
|
6
5
|
init: function init() {
|
|
7
|
-
|
|
8
|
-
let fontCookie = pmc.cookie.get( 'iw_fonts_loaded' );
|
|
6
|
+
const fontCookie = pmc.cookie.get( 'iw_fonts_loaded' );
|
|
9
7
|
|
|
10
8
|
if ( 'undefined' !== typeof fontCookie && fontCookie ) {
|
|
11
|
-
|
|
12
9
|
this.load( 'directload' );
|
|
13
|
-
|
|
14
10
|
} else {
|
|
15
|
-
|
|
16
11
|
window.addEventListener( 'load', () => {
|
|
17
|
-
|
|
18
12
|
this.load( 'load' );
|
|
19
|
-
|
|
20
13
|
} );
|
|
21
14
|
}
|
|
22
|
-
|
|
23
15
|
},
|
|
24
16
|
|
|
25
17
|
load: function load( type ) {
|
|
26
|
-
|
|
27
18
|
const currentThemeUrl = this.getThemeUrl();
|
|
28
19
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
WebFont.load(
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
);
|
|
20
|
+
const loadcount = this.loadcount++;
|
|
21
|
+
|
|
22
|
+
WebFont.load( {
|
|
23
|
+
google: {
|
|
24
|
+
families: [ 'PT Sans:400,700', 'Teko:300,400' ],
|
|
25
|
+
},
|
|
26
|
+
custom: {
|
|
27
|
+
families: [ 'Argent CF' ],
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
active: function webfontsLoaderActive() {
|
|
31
|
+
try {
|
|
32
|
+
if ( 'load' == type ) {
|
|
33
|
+
pmc.cookie.set(
|
|
34
|
+
'iw_fonts_loaded',
|
|
35
|
+
1,
|
|
36
|
+
7 * 24 * 60 * 60
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
console.log( 'fonts loaded ' + type );
|
|
40
|
+
} catch ( e ) {}
|
|
41
|
+
},
|
|
42
|
+
} );
|
|
55
43
|
},
|
|
56
44
|
|
|
57
45
|
getThemeUrl: function getThemeUrl() {
|
|
58
|
-
|
|
59
46
|
if ( 'undefined' === typeof pmc_common_urls ) {
|
|
60
47
|
return '';
|
|
61
|
-
} else {
|
|
62
|
-
return pmc_common_urls.current_theme_uri;
|
|
63
48
|
}
|
|
64
|
-
|
|
49
|
+
return pmc_common_urls.current_theme_uri;
|
|
50
|
+
},
|
|
65
51
|
};
|
|
66
52
|
|
|
67
53
|
export default webFontConfig;
|