PluginProbe
Search Atlas SEO – OTTO AI SEO Automation for WordPress / 2.7.2
Search Atlas SEO – OTTO AI SEO Automation for WordPress v2.7.2
2.7.1 2.7.2 2.7.0 2.6.26 2.6.25 2.6.24 2.6.23 2.6.22 2.6.21 2.6.20 2.6.19 2.6.18 2.6.17 2.6.16 2.6.15 2.6.14 2.6.13 2.6.12 2.6.11 2.6.10 2.6.9 2.6.8 2.6.7 2.6.6 2.6.5 All 141 releases
metasync / public / js / metasync-public.js

metasync-public.js in Search Atlas SEO – OTTO AI SEO Automation for WordPress 2.7.2, at public/js/metasync-public.js

36 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Front-end behaviour for the [accordion_metasync] shortcode.
3 *
4 * Vanilla JS on purpose: this is the only script the shortcode needs, and
5 * depending on jQuery here forced jQuery to load on every front-end request.
6 */
7 (function () {
8 'use strict';
9
10 function init() {
11 var panels = document.querySelectorAll('.metasync-accordion-block.metasync-panel');
12 for (var i = 0; i < panels.length; i++) {
13 panels[i].style.display = 'none';
14 }
15
16 var buttons = document.querySelectorAll('button.metasync-accordion');
17 for (var j = 0; j < buttons.length; j++) {
18 buttons[j].addEventListener('click', function (event) {
19 // Mirrors the jQuery handler's `return false` (preventDefault + stopPropagation).
20 event.preventDefault();
21 event.stopPropagation();
22
23 if (this.parentNode && this.parentNode.classList) {
24 this.parentNode.classList.toggle('metasync-active');
25 }
26 });
27 }
28 }
29
30 if (document.readyState === 'loading') {
31 document.addEventListener('DOMContentLoaded', init);
32 } else {
33 init();
34 }
35 })();
36