PageSourceSearch

https://oeagg.at/wp-content/plugins/dynamic-visibility-for-elementor/assets/js/visibility.js?ver=6.0.6

js oeagg.at collected 2026-09-25 06:49:54 UTC 4,567 bytes, 150 lines download raw bytes

1"use strict";
2
3(() => {
4	const initVisibility = ($e) => {
5		const e = $e[0];
6		if (
7			!$e.hasClass("dce-visibility-event") ||
8			$e.hasClass("dce-visibility-event-initialized")
9		) {
10			return;
11		}
12		$e.addClass("dce-visibility-event-initialized");
13		const settings = JSON.parse(e.dataset.settings);
14		const shouldHide = settings.dce_visibility_selected === "hide";
15		const triggerElement = settings.dce_visibility_click;
16		const triggerEvent = settings.dce_visibility_event;
17		const triggerAnimation = settings.dce_visibility_click_show;
18		const hideOther = settings.dce_visibility_click_other;
19		const showOnLoad = settings.dce_visibility_load === "yes";
20		const isToggle = settings.dce_visibility_click_toggle === "yes";
21		const showOnLoadDelay = settings.dce_visibility_load_delay;
22		const showOnLoadAnimation = settings.dce_visibility_load_show;
23		const $hideOther = jQuery(hideOther).not($e);
24		const transitionDelay = settings.dce_visibility_event_transition_delay;
25		// Will become true if there this trigger element is already in charge
26		// of hiding the same others. Do not do it twice:
27		let hideOtherAlreadyHandled = false;
28		const afterShow = () => {
29			elementorFrontend.elementsHandler.runReadyTrigger($e);
30		};
31		const toggle = () => {
32			if ($e.hasClass("dce-visibility-element-hidden")) {
33				$e.removeClass("dce-visibility-element-hidden");
34				$e.hide();
35			}
36			if (triggerAnimation === "slide") {
37				$e.delay(transitionDelay).slideToggle(
38					transitionDelay,
39					afterShow,
40				);
41			} else if (triggerAnimation === "fade") {
42				$e.delay(transitionDelay).fadeToggle(
43					transitionDelay,
44					afterShow,
45				);
46			} else {
47				$e.toggle();
48				afterShow();
49			}
50		};
51		const show = () => {
52			// .removeClass and .hide are needed because otherwise .show will
53			// always set display to block:
54			$e.removeClass("dce-visibility-element-hidden");
55			$e.hide();
56			if (triggerAnimation === "slide") {
57				$e.delay(transitionDelay).slideDown(transitionDelay, afterShow);
58			} else if (triggerAnimation === "fade") {
59				$e.delay(transitionDelay).fadeIn(transitionDelay, afterShow);
60			} else {
61				$e.show();
62				afterShow();
63			}
64		};
65		const hide = () => {
66			if (triggerAnimation === "slide") {
67				$e.delay(transitionDelay).slideUp(transitionDelay);
68			} else if (triggerAnimation === "fade") {
69				$e.delay(transitionDelay).fadeOut(transitionDelay);
70			} else {
71				$e.hide();
72			}
73		};
74		const hideOtherElements = (callback) => {
75			if (triggerAnimation === "slide") {
76				$hideOther
77					.delay(transitionDelay)
78					.slideUp(transitionDelay, callback);
79			} else if (triggerAnimation === "fade") {
80				$hideOther
81					.delay(transitionDelay)
82					.fadeOut(transitionDelay, callback);
83			} else {
84				$hideOther.hide();
85				callback();
86			}
87		};
88		const triggerEventCallback = (event) => {
89			// Check if the clicked element has an anchor link
90			const $clickedElement = jQuery(event.target);
91			const href = $clickedElement.attr('href') || $clickedElement.closest('a').attr('href');
92			const isAnchorLink = href && href.startsWith('#');
93			
94			// Prevent default for non-anchor links or when href is only '#'
95			if (!isAnchorLink || href === '#') {
96				event.preventDefault();
97			}
98			
99			const triggerFun = isToggle ? toggle : shouldHide ? hide : show;
100			if (hideOther && !hideOtherAlreadyHandled) {
101				hideOtherElements(triggerFun);
102			} else {
103				triggerFun();
104			}
105		};
106
107		// See the commend on hideOtherElements definition
108		const handleHideOthers = ($triggerElement) => {
109			let hideOthers = $triggerElement.data("dce-hide-others") || {};
110			if (hideOthers[hideOther]) {
111				hideOtherAlreadyHandled = true;
112			} else {
113				hideOthers[hideOther] = true;
114				$triggerElement.data("dce-hide-others", hideOthers);
115			}
116		};
117
118		if (triggerElement) {
119			let $triggerElement = jQuery(triggerElement);
120			if (hideOther) {
121				handleHideOthers($triggerElement);
122			}
123			$triggerElement.on(triggerEvent, triggerEventCallback);
124		}
125		if (showOnLoad) {
126			setTimeout(() => {
127				if (shouldHide) {
128					hide();
129					return;
130				}
131				$e.removeClass("dce-visibility-element-hidden");
132				$e.hide();
133				if (showOnLoadAnimation === "slide") {
134					$e.slideToggle(transitionDelay, afterShow);
135				} else if (showOnLoadAnimation === "fade") {
136					$e.fadeToggle(transitionDelay, afterShow);
137				} else {
138					$e.toggle();
139					afterShow();
140				}
141			}, showOnLoadDelay);
142		}
143	};
144	jQuery(window).on("elementor/frontend/init", () => {
145		elementorFrontend.hooks.addAction(
146			"frontend/element_ready/global",
147			initVisibility,
148		);
149	});
150})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.