PageSourceSearch

https://gazoo.com/U-Car/resource_new/js/shopmap.js

js gazoo.com collected 2026-10-02 03:57:59 UTC 2,297 bytes, 65 lines download raw bytes

1function setupShopmapAccordion() {
2	try {
3		function openShopmapAccordionIfChecked() {
4			const accordionButtons = $(".js-accordion-shopmap-title");
5			const accordionContents = $(".js-accordion-shopmap-content");
6
7			// 初期状態は閉じる
8			accordionButtons.attr("data-accordion-role", "close").removeClass("open");
9			accordionContents.hide();
10
11			//子要素のチェックが入っていると開く
12			accordionContents.each(function (index, content) {
13				const checkboxes = $(content).find('input[type="checkbox"]');
14				checkboxes.each(function (_, checkbox) {
15					if ($(checkbox).is(":checked")) {
16						const btn = $(accordionButtons[index]);
17						const accordionContent = $(content);
18
19						btn.attr("data-accordion-role", "open").addClass("open");
20						accordionContent.slideDown();
21					}
22				});
23			});
24		}
25
26		$(".js-accordion-shopmap-title").off("click")
27		$(".js-accordion-shopmap-title").on("click", function () {
28			var $this = $(this);
29			var $accordionContent = $this.next(".js-accordion-shopmap-content");
30
31			$accordionContent.slideToggle();
32			var isOpen = $this.attr("data-accordion-role") === "open";
33			$this.attr("data-accordion-role", isOpen ? "close" : "open");
34
35			if (isOpen) {
36				$this.removeClass("open");
37			} else {
38				$this.addClass("open");
39			}
40		});
41
42		// 地域検索モーダル内チェックボックス11以上選択不可
43		const LIMIT = 10;
44		const $container = $("#modal-shopmap");
45
46		$container.on("change", "input[type=checkbox]", function() {
47			const checkedCount = $container.find(".checked-limit input[type=checkbox]:checked").length;
48
49			if (checkedCount >= LIMIT) {
50				$container.find("input[type=checkbox]:not(:checked)").prop("disabled", true);
51			} else {
52				$container.find("input[type=checkbox]").prop("disabled", false);
53			}
54		});
55
56		// 初期状態でチェックされているチェックボックスを探してアコーディオンを開く
57		openShopmapAccordionIfChecked();
58		const $allCheckboxes = $(".js-accordion-shopmap-content").find('input[type="checkbox"]');
59		if ($allCheckboxes.filter(":checked").length === 0) {
60			$("#a0").prop("checked", true).trigger("change");
61		}
62	} catch (error) {
63		console.error("JavaScriptエラー:", error);
64	}
65}

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.