PageSourceSearch

https://ouidalagos.com/wp-content/themes/scape/library/js/module-language-switch.js?ver=1.5.12

js ouidalagos.com collected 2026-10-02 22:31:19 UTC 2,207 bytes, 78 lines download raw bytes

1(function() {
2	"use strict";
3	window.SCAPE = window.SCAPE || {};
4	var $ = jQuery.noConflict();
5
6	SCAPE.languageSwitch = {
7
8		init: function() {
9
10			SCAPE.viewport = function() {
11				var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight;
12				return { width:x,height:y }
13			};
14
15			SCAPE.languageSwitch.layout();
16			$(window).resize(function() {
17				SCAPE.waitForFinalEvent( function() {
18					SCAPE.languageSwitch.layout();
19				}, SCAPE.timeToWaitForLast, 'languageDropdown');
20			});
21
22			var $trigger = $('.header_language_trigger');
23			$trigger.on('click', function() {
24				var $wrapper	= $(this).closest('.header_language_wrapper'),
25					$dropdown	= $wrapper.find('.header_language_dropdown');
26
27				if ( !$wrapper.hasClass('active') ) {
28					var offset = $wrapper.offset().top,
29						height = $wrapper.outerHeight(true) + $dropdown.outerHeight(true);
30
31					$dropdown.removeClass('dropdown_top');
32					$dropdown.removeClass('dropdown_opposite');
33
34					if ( offset + height > SCAPE.scrollTop.get + SCAPE.viewport().height ) {
35						$dropdown.addClass('dropdown_top');
36					} else {
37						$dropdown.removeClass('dropdown_top');
38					}
39					if ( $dropdown.offset().left < 0 ) {
40						$dropdown.addClass('dropdown_opposite');
41					} else {
42						$dropdown.removeClass('dropdown_opposite');
43					}
44
45					$wrapper.addClass('active');
46					$(document).on('click.lang_dropdown', function(e) {
47						if ( !$wrapper.is(e.target) && !$wrapper.find(e.target).length ) {
48							$wrapper.removeClass('active');
49						}
50					});
51				} else {
52					$wrapper.removeClass('active');
53					$(document).off('click.lang_dropdown');
54				}
55			});
56		},
57
58		layout: function() {
59			var $trigger = $('.header_language_trigger');
60
61			$trigger.each(function () {
62				var $dropdown = $(this).next('.header_language_dropdown');
63
64				if ($trigger.offset().left + $trigger.width() - $dropdown.width() < 0) {
65					$dropdown.addClass('dropdown_opposite');
66				} else {
67					$dropdown.removeClass('dropdown_opposite');
68				}
69			});
70		}
71
72	};
73
74	jQuery(document).ready(function($) {
75		SCAPE.languageSwitch.init();
76	});
77
78})(jQuery);

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.