PluginProbe
Blockenberg — 600+ Advanced Gutenberg Blocks & AI Agent for WordPress Block Editor / 2.0.7
Blockenberg — 600+ Advanced Gutenberg Blocks & AI Agent for WordPress Block Editor v2.0.7
2.0.13 2.0.12 2.0.11 2.0.10 2.0.9 trunk 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8
blockenberg / blocks / hover-card / frontend.js

frontend.js in Blockenberg — 600+ Advanced Gutenberg Blocks & AI Agent for WordPress Block Editor 2.0.7, at blocks/hover-card/frontend.js

27 lines 860 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /* Hover Card — frontend.js */
2 /* Primary reveal is CSS-driven. This adds touch-device support. */
3 ( function () {
4 function init() {
5 document.querySelectorAll( '.bkhc-card' ).forEach( function ( card ) {
6 card.addEventListener( 'touchstart', function () {
7 card.classList.toggle( 'bkhc-touch-active' );
8 }, { passive: true } );
9 } );
10
11 // Close touch-active when tapping outside
12 document.addEventListener( 'touchstart', function ( e ) {
13 document.querySelectorAll( '.bkhc-card.bkhc-touch-active' ).forEach( function ( card ) {
14 if ( ! card.contains( e.target ) ) {
15 card.classList.remove( 'bkhc-touch-active' );
16 }
17 } );
18 }, { passive: true } );
19 }
20
21 if ( document.readyState === 'loading' ) {
22 document.addEventListener( 'DOMContentLoaded', init );
23 } else {
24 init();
25 }
26 } )();
27