PageSourceSearch

https://www.vivocity.com.sg/wp-content/themes/twentynineteen-child/js/ui-modal.js

js vivocity.com.sg collected 2026-10-01 14:32:55 UTC 1,580 bytes, 53 lines download raw bytes

1(function(window, document) {
2	'use strict';
3
4	function openSimpleModal(modalSelector, options) {
5		var settings = options || {};
6		var modal = document.querySelector(modalSelector);
7		if (!modal) {
8			return;
9		}
10
11		if (modal.dataset.closeTimer) {
12			clearTimeout(Number(modal.dataset.closeTimer));
13			delete modal.dataset.closeTimer;
14		}
15
16		modal.classList.remove(settings.closingClass || 'is-closing');
17		modal.style.display = 'block';
18		modal.offsetHeight;
19		modal.classList.add('show');
20		modal.setAttribute('aria-hidden', 'false');
21		document.body.classList.add('modal-open');
22	}
23
24	function closeSimpleModal(modalSelector, options) {
25		var settings = options || {};
26		var modal = document.querySelector(modalSelector);
27		var closingClass = settings.closingClass || 'is-closing';
28		var duration = typeof settings.duration === 'number' ? settings.duration : 220;
29
30		if (!modal) {
31			return;
32		}
33
34		modal.classList.add(closingClass);
35		modal.classList.remove('show');
36		modal.setAttribute('aria-hidden', 'true');
37		modal.dataset.closeTimer = String(window.setTimeout(function() {
38			if (modal.classList.contains('show')) {
39				return;
40			}
41			modal.style.display = 'none';
42			modal.classList.remove(closingClass);
43			if (!document.querySelector('.modal.show')) {
44				document.body.classList.remove('modal-open');
45			}
46			delete modal.dataset.closeTimer;
47		}, duration));
48	}
49
50	window.vivoModalHelpers = window.vivoModalHelpers || {};
51	window.vivoModalHelpers.openSimpleModal = openSimpleModal;
52	window.vivoModalHelpers.closeSimpleModal = closeSimpleModal;
53})(window, document);

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.