PluginProbe
Blockenberg — 600+ Advanced Gutenberg Blocks & AI Agent for WordPress Block Editor / 2.0.11
Blockenberg — 600+ Advanced Gutenberg Blocks & AI Agent for WordPress Block Editor v2.0.11
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 / google-map / frontend.js

frontend.js in Blockenberg — 600+ Advanced Gutenberg Blocks & AI Agent for WordPress Block Editor 2.0.11, at blocks/google-map/frontend.js

34 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function () {
2 'use strict';
3
4 /**
5 * Blockenberg Google Map — frontend script
6 *
7 * Minimal enhancement:
8 * - Ensures every iframe has a title for accessibility (in case a theme strips it).
9 * - Adds keyboard focusability to the iframe so keyboard users can interact.
10 */
11 function initMaps() {
12 var maps = document.querySelectorAll('.bkbg-gm-wrap iframe');
13 if (!maps.length) return;
14
15 maps.forEach(function (iframe) {
16 // Ensure title attribute exists (accessibility/screen-readers)
17 if (!iframe.getAttribute('title')) {
18 iframe.setAttribute('title', 'Google Map');
19 }
20
21 // Make iframe keyboard-focusable if it isn't already
22 if (!iframe.hasAttribute('tabindex')) {
23 iframe.setAttribute('tabindex', '0');
24 }
25 });
26 }
27
28 if (document.readyState === 'loading') {
29 document.addEventListener('DOMContentLoaded', initMaps);
30 } else {
31 initMaps();
32 }
33 })();
34