PageSourceSearch

https://www.oakhouse.jp/js/rwd/listmap_fuel.js?20260926044025

js oakhouse.jp collected 2026-09-25 19:40:53 UTC 44,859 bytes, 1,410 lines download raw bytes

1var MAPJS = MAPJS | {};
2var MAPTIP = MAPTIP | {};
3var MKTPRCJS = MKTPRCJS | {};
4
5$(function ( ) {
6
7	MAPJS = {
8		data: {
9			firstFlag: true,
10			cityOptionsByState: null,
11			cityOptionsByArea: null,
12			resetFlag: true
13		},
14		init: function () {
15
16			this.initSlick();
17			//this.initSticky();
18			this.initMapHeight();
19			this.initCheckFullHdToggle();
20			this.toggleGetMyLatlang();
21			this.initSearchdrawerPulldown();
22			this.initAreaSelect();
23			this.initFreeword();
24			this.initCommute();
25			this.checkHasActive();
26			this.initStats();
27			//this.initMapDrag();
28			this.initResetAreaButton();
29			this.initOnChange();
30			this.initReturn();
31			this.initWrapperZindex();
32			this.initSortSelector();
33			this.initRollUp();
34			this.initToggleAll();
35			this.initHoverSync();
36			this.initToggleAccordion();
37			this.initToggleStyle();
38			this.initSwitchMap();
39			this.initScrollHideObj();
40			this.initPopularFilter();
41		},
42		initSlick: function () {
43
44			$('.c-tab__content.is-active .js-caset_slick:not(.slick-initialized)').each(function () {
45				init($(this));
46			})
47
48			//animationが0.6sなので、1%目からblock要素になるため 0.6*1000/100で6ms以上の遅延を設定、
49			setTimeout(() => {
50				MAPJS.updateSlick();
51			}, 50);
52
53			$('.js-tab a').on('click', function () {
54				setTimeout(() => {
55					MAPJS.initSlick();
56				}, 50);
57			})
58
59			function init(target) {
60				var $this = target;
61				var opt = genOpt(target);
62
63				$this.on('init', function (e, slick) {
64					$this.append('<div class="slick-counter"><span class="slick-counter-current"></span> / <span class="slick-counter-total"></span><span class="slick-counter-date"></span></div>');
65					$('.slick-counter-current', $this).text(slick.currentSlide + 1);
66					$('.slick-counter-total', $this).text(slick.slideCount);
67					var date = $this.find('.slick-slide:not(.slick-cloned)').eq(0).data('date');
68					$('.slick-counter-date', $this).text(date);
69				})
70					.slick(opt)
71					.on('beforeChange', function (event, slick, currentSlide, nextSlide) {
72						$('.slick-counter-current', $this).text(nextSlide + 1);
73						var date = $this.find('.slick-slide:not(.slick-cloned)').eq(nextSlide).data('date');
74						$('.slick-counter-date', $this).text(date);
75					})
76			}
77
78			function genOpt(target) {
79				var opt = {
80					lazyLoad: 'ondemand',
81					speed: 400,
82					easing: 'swing',
83				};
84				var $this = $(target);
85				var isSp = window.matchMedia('screen and (max-width: 820px)').matches;
86				var isPr = $this.parents('.p-searchmap__item').hasClass('ext-pr');
87				var isRoom = $this.parents('.p-searchmap__item').hasClass('ext-room');
88				var isList = $this.parents('.p-searchmap').hasClass('is-list');
89				var hasTenant = $this.parents('.p-searchmap__item').find('.p-searchmap__tenant').length;
90				var myWidth = $this.outerWidth();
91				//var maxWidth = (isPr)? 282: 240;
92				var maxWidth = 240;
93				var centerModeSwitch = (myWidth > maxWidth) ? true : false;
94				var slides = Math.floor(myWidth / maxWidth);
95				var visiblePr = $('.p-searchmap__item.ext-pr:visible').length;
96
97				//Room統合前分岐
98				// if(centerModeSwitch && !isRoom){
99				if(centerModeSwitch){
100					//myPadding = (myWidth - maxWidth*slides)/2+'px';
101					// $this.slick('slickSetOption', 'centerMode', centerModeSwitch);
102					// $this.slick('slickSetOption', 'centerPadding', myPadding+'px');
103					// $this.slick('slickSetOption', 'slidesToShow', slides);
104					$this.addClass('is-centermode');
105					opt.slidesToShow = slides;
106
107					//リスト系、PRではなくかつ人口グラフ無しの場合
108					//if (isList && !hasTenant && window.matchMedia('screen and (min-width: 1331px)').matches) {
109					//	opt.slidesToShow = 2;
110					//	if (isPr && window.matchMedia('screen and (min-width: 1440px)').matches) {
111					//		if (visiblePr >= 3) {
112					//			opt.slidesToShow = 1;
113					//		}
114					//		if (visiblePr == 2) {
115					//			opt.slidesToShow = 2;
116					//		}
117					//		if (visiblePr == 1) {
118					//			opt.slidesToShow = 3;
119					//		}
120					//	}
121					//}
122				} else {
123					//固定レイアウト
124					// $this.slick('slickSetOption', 'centerMode', false);
125					// $this.slick('slickSetOption', 'centerPadding', '0px');
126					// $this.slick('slickSetOption', 'slidesToShow', 1);
127					opt.slidesToShow = 1;
128					$this.removeClass('is-centermode');
129
130					//リスト系、かつ部屋表示の場合
131					//Room統合前分岐
132					//if (isList && isRoom && window.matchMedia('screen and (min-width: 960px) and (max-width: 1180px)').matches) {
133					if(isList && window.matchMedia('screen and (min-width: 960px) and (max-width: 1180px)').matches) {
134
135						opt.slidesToShow = 2;
136					}
137				}
138
139				return opt;
140			}
141
142			function updateSlick() {
143				$('.c-tab__content.is-active .js-caset_slick.slick-initialized').each(function () {
144					$(this).slick('slickSetOption', genOpt(this), true);
145				})
146			}
147
148			MAPJS.updateSlick = updateSlick;
149
150			var timer = false;
151
152			if (MAPJS.data.firstFlag) {
153				MAPJS.data.firstFlag = false;
154				$(window).on('resize', function () {
155
156					if (timer !== false) {
157						clearTimeout(timer);
158						timer = false;
159					}
160
161					timer = setTimeout(function () {
162						clearTimeout(timer);
163						timer = false;
164						updateSlick();
165					}, 200);
166				});
167			}
168		},
169		initReturn: function () {
170			var $return = $('.p-searchmap__return');
171			$(window).on('resize', checkPos);
172			$(window).on('scroll', checkPos);
173			checkPos();
174
175			function checkPos() {
176				var wh = $(window).innerHeight();
177				var nowPos = $(window).scrollTop();
178
179				if (nowPos > wh) {
180					$return.addClass('is-active');
181				} else {
182					$return.removeClass('is-active');
183				}
184			}
185		},
186		initSticky: function () {
187			if ($('.p-searchmap__edit').length <= 0) return false;
188
189
190			toggleCheckTarget();
191			$(window).on('resize', toggleCheckTarget);
192
193			function toggleCheckTarget() {
194				$('.p-searchmap__content').off('scroll', posCheck);
195				$(window).off('scroll', posCheck);
196
197				if (window.matchMedia('screen and (max-width: 820px)').matches) {
198					$(window).on('scroll', posCheck);
199				} else {
200					$('.p-searchmap__content').on('scroll', posCheck);
201				}
202			}
203
204
205			function posCheck() {
206				var $button = $('.js-button_sticky');
207				var $wrapper = $('.p-searchmap__edit');
208				var myTop = $wrapper.position().top;
209				var thred = 20;
210				var myPos = $('#header_rwd').outerHeight() + $('.c-plist').outerHeight();
211
212				if (myTop <= thred) {
213					$button.addClass('is-fixed');
214					$button.css('top', (myPos + 20) + 'px');
215				} else {
216					$button.removeClass('is-fixed');
217				}
218			}
219		},
220		initMapHeight: function () {
221			$(window).on('resize', MAPJS.setHeight);
222			MAPJS.setHeight();
223		},
224		setHeight: function () {
225			var $searchmap = $('.p-searchmap');
226			var $header = $('#header_rwd');
227			var $drawer = $('.c-drawer');
228			var $plist = $('.c-plist');
229			var $areaui = $('.p-searchDrawer__area, .p-searchDrawer__special');
230			var $popular = $('.p-searchDrawer__popular');
231			var $latlang = $('.p-searchmap__getlatlang');
232			var $content = $('.p-searchmap__content');
233			var $hitcount = $('.p-searchmap__hitcount');
234			var $gmap = $('.p-gmap');
235
236			var totalHeight = $header.outerHeight() + $plist.outerHeight() + $drawer.outerHeight();
237			if(window.matchMedia('screen and (max-width: 820px)').matches){
238				//人気の検索条件の有無で分岐
239				if($popular.length) {
240					$searchmap.css({
241						'margin-top': $areaui.outerHeight() + $popular.outerHeight() + $plist.outerHeight() + 'px'
242					});
243					$popular.css({
244						top:  $areaui.outerHeight() + $plist.outerHeight() + $header.outerHeight()+'px',
245						'margin-left': 0
246					});
247					$content.css({
248						'margin-top': 'calc( 100svh - '+($areaui.outerHeight() + $plist.outerHeight() + $header.outerHeight() + $popular.outerHeight() + 70) + 'px)'
249					})
250					$gmap.css({
251						'top': 'auto',
252						'height': 'calc( 100lvh - '+($areaui.outerHeight() + $plist.outerHeight() + $header.outerHeight() + $popular.outerHeight()) + 'px)',
253					});
254					$latlang.css({
255						'margin-top': 'calc( 100svh - '+($areaui.outerHeight() + $plist.outerHeight() + $header.outerHeight() + $popular.outerHeight() + 70) + 'px)'
256					})
257					$hitcount.css({
258						'margin-top': 'calc( 100svh - '+($areaui.outerHeight() + $plist.outerHeight() + $header.outerHeight() + $popular.outerHeight() + 70) + 'px)'
259					})
260				}else{
261					$searchmap.css({
262						'margin-top': $areaui.outerHeight() + $plist.outerHeight() + 'px'
263					});
264					$content.css({
265						'margin-top': 'calc( 100svh - '+ ($areaui.outerHeight() + $plist.outerHeight() + $header.outerHeight() + 70) + 'px)'
266					})
267					$gmap.css({
268						'top': 'auto',
269						'height': 'calc( 100svh - '+ ($areaui.outerHeight() + $plist.outerHeight() + $header.outerHeight() + 70) + 'px)',
270					});
271					$latlang.css({
272						'margin-top': 'calc( 100svh - '+ ($areaui.outerHeight() + $plist.outerHeight() + $header.outerHeight() + 70) + 'px)'
273					})
274					$hitcount.css({
275						'margin-top': 'calc( 100svh - '+ ($areaui.outerHeight() + $plist.outerHeight() + $header.outerHeight() + 70) + 'px)'
276					})
277				}
278				$plist.css({
279					'top': $header.outerHeight() + 'px'
280				});
281				$areaui.css({
282					top: $plist.outerHeight() + $header.outerHeight() + 'px'
283				});
284				$drawer.css({
285					top: ('auto')
286				})
287				$('.js-searcdrawer_pulldown + div').css({
288					'max-height': '100%',
289				})
290			} else {
291				$searchmap.css({
292					'margin-top': totalHeight + 'px'
293				});
294				$plist.css({
295					'top': $header.outerHeight() + 'px'
296				});
297				$areaui.css({
298					'top':  'auto'
299				});
300				$popular.css({
301					'top':  'auto',
302					'margin-left': 'calc( 2em + '+$areaui.outerWidth() + 'px)'
303				});
304				$drawer.css({
305					top:  $plist.outerHeight() + $header.outerHeight()+'px'
306				})
307				$gmap.css({
308					'top': totalHeight + 'px',
309					'height': 'calc( 100lvh - '+totalHeight+'px )',
310				});
311				$content.css({
312					'margin-top': '0'
313				})
314				$latlang.css({
315					'margin-top': 'auto'
316				})
317				$hitcount.css({
318					'margin-top': 'auto'
319				})
320				$('.js-searcdrawer_pulldown + div').css({
321					'max-height': 'calc( 100dvh - ' + totalHeight + 'px )',
322				})
323				//ドロワーが開いていたら閉じる
324				if ($('#wrapper').hasClass('is-drawerOpen')) {
325					$('.js-drawer_close').trigger('click');
326				}
327			}
328
329			$(window).off('scroll', toggleCountFixed);
330			$(window).on('scroll', toggleCountFixed);
331
332			function toggleCountFixed() {
333				var scrollPos = $(window).scrollTop();
334				var pos = $('.c-history').offset().top - $gmap.outerHeight() - parseInt($gmap.css('top'), 10);
335				if (!window.matchMedia('screen and (max-width: 820px)').matches) {
336					if (scrollPos > pos) {
337						$hitcount.addClass('is-absolute');
338						//$hitcount.css('top', (pos+10)+'px');
339					} else {
340						$hitcount.removeClass('is-absolute');
341						//$hitcount.css('top', totalHeight+'px');
342					}
343				} else {
344
345				}
346			}
347		},
348		toggleGetMyLatlang: function () {
349			$('.js-toggle_getlatlang').on( 'click', function () {
350				if($(this).hasClass('is-active')){
351					$(this).removeClass('is-active');
352				}else{
353					$(this).addClass('is-active');
354				}
355			})
356		},
357		initSearchdrawerPulldown: function () {
358			$('.js-searcdrawer_pulldown').on('click', function (e) {
359				e.stopPropagation();
360				var $me = $(this);
361				var $target = $me.next();
362
363				if ($me.hasClass('is-active')) {
364					$target.removeClass('is-active').slideUp(400);
365					$me.removeClass('is-active');
366					MAPJS.checkHasActive();
367				} else {
368					MAPJS.checkHasActive();
369					$('.js-searcdrawer_pulldown.is-active').removeClass('is-active');
370					$('.js-searcdrawer_pulldown + div.is-active').removeClass('is-active').slideUp(0);
371					$target.addClass('is-active').slideDown(400);
372					$me.addClass('is-active');
373				}
374			})
375			// WEB-5086
376			// $('.js-searcdrawer_pulldown + div').on('click', function (e) {
377			// 		e.stopPropagation();
378			// })
379			$('.js-searchdrawer_close').on('click', MAPJS.closeSearchdrawerPulldown)
380			$(document).on('click', 'body', MAPJS.closeSearchdrawerPulldown);
381			$(document).on('click', '.p-searchDrawer', function (e) {
382				e.stopPropagation();
383			});
384			$(document).on('click', '.ui-multiselect-menu', function (e) {
385				e.stopPropagation();
386			});
387
388			$(document).on('click','.ui-menu',function (e) {
389				e.stopPropagation();
390			})
391		},
392		closeSearchdrawerPulldown: function () {
393			$('.js-searcdrawer_pulldown.is-active').removeClass('is-active');
394			$('.js-searcdrawer_pulldown + div.is-active').removeClass('is-active').slideUp(400);
395			if ($('.ui-multiselect').hasClass('ui-state-active')) {
396				$('.ui-multiselect').trigger('click');
397			}
398			MAPJS.checkHasActive();
399		},
400		checkHasActive: function () {
401			$('.js-searcdrawer_pulldown:not(.ext-slider):not(.ext-select):not(.ext-area):not(.ext-commute)').each(function () {
402				$checkboxes = $(this).next().find('input[type=checkbox]');
403
404				var checked = false;
405
406				$checkboxes.each(function () {
407					if ($(this).prop('checked')) {
408						checked = true;
409					}
410				})
411
412				if (checked !== false) {
413					$(this).addClass('has-active');
414				} else {
415					$(this).removeClass('has-active');
416				}
417			})
418		},
419		initAreaSelect: function () {
420			if (!$('.js-select_city').length > 0) return false;
421			var $prefSelector = $('.js-select_prefectures');
422			var $areaSelector = $('.js-select_area');
423			var $citySelector = $('.js-select_city');
424			$('.js-select_prefectures').on('change', checkSelected);
425			$('.js-select_area').on('change', checkSelected);
426			checkSelected();
427
428			//リサイズ時にcheckSelectedを実行
429			var timer = false;
430			$(window).on('resize', function () {
431
432				if (timer !== false) {
433					clearTimeout(timer);
434				}
435
436				timer = setTimeout(function () {
437					clearTimeout(timer);
438					checkSelected();
439				}, 200);
440			})
441
442			function checkSelected() {
443				var $parentbutton = $('.p-searchDrawer__area .js-searcdrawer_pulldown.ext-area, .p-searchDrawer__special .js-searcdrawer_pulldown.ext-area');
444				var $listbutton = $('.p-searchDrawer__area .p-searchDrawer__list .c-button, .p-searchDrawer__special .p-searchDrawer__list .c-button');
445
446				var $selectedPrefecture = $prefSelector.find('option:selected');
447				var prefectures = $selectedPrefecture.data('prefectures');
448
449				var $selectedArea = $areaSelector.find('option:selected');
450				var area = $selectedArea.data('area');
451
452				var $selectedCity = $citySelector.find('.js-multiple').val();
453				var city = 'default';
454
455				if ($selectedCity.length > 0) {
456					city = '';
457					$selectedCity.forEach(function (val, index) {
458						if (index !== 0) city += ', ';
459						city += $citySelector.find('option[value=' + val + ']').text();
460					})
461				}
462
463				var buttontext = '';
464
465				if (prefectures == '13') {
466					$areaSelector.addClass('is-active');
467					$citySelector.addClass('is-active');
468				} else if (prefectures == 'default') {
469					$areaSelector.find('select').prop("selectedIndex", 0);
470					$areaSelector.removeClass('is-active');
471					$citySelector.removeClass('is-active');
472				} else {
473					$areaSelector.find('select').prop("selectedIndex", 0);
474					$areaSelector.removeClass('is-active');
475					$citySelector.addClass('is-active');
476				}
477				if (prefectures !== 'default') {
478					$prefSelector.addClass('has-active');
479					$prefSelector.parents('.p-searchDrawer__area, .p-searchDrawer__special').find('.js-searcdrawer_pulldown').addClass('has-active');
480					$listbutton.removeClass('is-disable');
481					buttontext += $selectedPrefecture.text();
482
483					//SP版の場合は更にボタンテキストを追加
484					if (window.matchMedia('screen and (max-width: 820px)').matches) {
485						if (prefectures == '13' && area !== 'default') buttontext += ' > ' + $selectedArea.text();
486						if (city !== 'default') buttontext += ' > ' + city;
487					}
488
489					$parentbutton.find('span').text(buttontext);
490				} else {
491					$listbutton.addClass('is-disable');
492					$prefSelector.removeClass('has-active');
493					$prefSelector.parents('.p-searchDrawer__area, .p-searchDrawer__special').find('.js-searcdrawer_pulldown').removeClass('has-active');
494					$parentbutton.find('span').text($parentbutton.data('defaulttext'));
495				}
496				MAPJS.setHeight();
497			}
498
499			$('.js-select_prefectures select').on('change', selectedArea)
500			$('.js-select_area select').on('change', selectedArea)
501			selectedArea();
502
503			function selectedArea() {
504				var $state_selected = $prefSelector.find('option:selected');
505				var $area_selected = $areaSelector.find('option:selected');
506				var state = $state_selected.data('prefectures');
507				var area = $area_selected.data('area');
508				var html = '';
509				$citySelector.find('option').remove();
510
511				if (state !== 'default' && state !== 13 && state in cityOptionsByState) {
512					$citySelector.find('select').append(cityOptionsByState[state]);
513				} else if (area !== 'default' && area in cityOptionsByArea) {
514					$citySelector.find('select').append(cityOptionsByArea[area]);
515				} else {
516					html = Object.values(cityOptionsByArea).join();
517					$citySelector.find('select').append(html);
518				}
519
520				//JISコードで並べる
521				var $sortedOption = $citySelector.find('option').sort(function (a, b) {
522					var aa = parseInt($(a).data('jis'), 10);
523					var bb = parseInt($(b).data('jis'), 10);
524					if (aa > bb) {
525						return 1;
526					} else if (aa < bb) {
527						return -1;
528					}
529					return 0;
530				});
531
532				//ソートしたoptionをセット
533				$citySelector.find('select').empty();
534				$citySelector.find('select').append($sortedOption);
535
536				if (area !== 'default') {
537					$areaSelector.addClass('has-active');
538				} else {
539					$areaSelector.removeClass('has-active');
540				}
541
542				if ($('.ui-multiselect').length > 0) {
543					$(".js-multiple").multiselect('destroy');
544				}
545				initMultiSelect();
546				MAPJS.setHeight();
547			}
548		},
549		initFreeword: function () {
550			var $freeword = $('input.js-freeword');
551			$('.js-freeword').on('blur', checkFreeword);
552			checkFreeword();
553
554			function checkFreeword() {
555				if($freeword.val()){
556					$freeword.addClass('is-active');
557					$freeword.parent().addClass('is-active');
558				}else{
559					$freeword.removeClass('is-active');
560					$freeword.parent().removeClass('is-active');
561				}
562			}
563
564			$('.js-clear_freeword').on('click', clearFreeword);
565
566			function clearFreeword (e) {
567				e.preventDefault();
568				$freeword.val('');
569				$freeword.removeClass('is-active');
570				$freeword.parent().removeClass('is-active');
571			}
572		},
573		initCommute: function () {
574			var $forms = $('.js-commute');
575			var $parentButton = $('.js-searcdrawer_pulldown.ext-commute');
576
577			$('.js-commute').on('blur', function () {
578				var flag = false;
579
580				$forms.each(function () {
581					if ($(this).val()) {
582						flag = true;
583					}
584				})
585
586				if(flag){
587					//ページ遷移時にhas-activeになるため
588					// $parentButton.addClass('has-active');
589				}else{
590					$parentButton.removeClass('has-active');
591					$parentButton.find('span').text( $parentButton.data('defaulttext'));
592				}
593			})
594		},
595		initStats: function () {
596			$('.js-stats_update').on('click', MAPJS.statsUpdate);
597			MAPJS.statsUpdate();
598			MAPJS.setHeight();
599		},
600		statsUpdate: function () {
601			//statsを空に
602			$('.js-filter_condition').html('');
603
604			//都道府県
605			//var $state = $('select[name=state_select_id]');
606			//if($state.val() !== ''){
607			//	var stateLabel = $state.find('option:selected')[0].innerText;
608			//	var stateValue = $state.val();
609			//	MAPJS.addFilterStats(stateLabel, 'state_select_id', stateValue);
610			//}
611
612			//エリア
613			//var $area = $('select[name=area_select_id]');
614			//if($area.val() !== ''){
615			//	var areaLabel = $area.find('option:selected')[0].innerText;
616			//	var areaValue = $area.val();
617			//	MAPJS.addFilterStats(areaLabel, 'area_select_id', areaValue);
618			//}
619
620			//市区郡
621			//var $city = $(".js-multiple");
622			//var selectedText =  '';
623			//if($city.multiselect('value').length > 0){
624			//	selectedText = $city.multiselect('getChecked').map(function(){
625			//		return $('#'+this.id).nextAll('span').text();
626			//	}).get().join(', ');
627			//	MAPJS.addFilterStats(selectedText, '.js-multiple', selectedText);
628			//}
629
630			//場所UI以降のチェックボックスとスライダーをプルダウンの並び順に処理
631			$('.p-searchDrawer__pulldown').each(function () {
632				if ($('.js-searcdrawer_pulldown', this).hasClass('ext-slider')) {
633					var sliderID = '#' + $('.drag_area > div', this).attr('id');
634					scanSlider(sliderID);
635				} else if ($('.js-searcdrawer_pulldown', this).hasClass('ext-select')) {
636					$('.p-searchDrawer__select', this).each(function () {
637						scanSelectCombo(this);
638					});
639				} else {
640					$('input[type!=hidden]:checked', this).each(function () {
641						scanCheckbox(this);
642					});
643				}
644			})
645
646			//checkboxの値を検索条件に追加
647			function scanCheckbox(target) {
648				var myName = $(target).attr('name');
649				var myValue = $(target).val();
650				//検索条件に表示するテキスト、titleがなければ後続のspanの中身を利用
651				var myLabel = ($(target).data('title')) ? $(target).data('title') : $(target).nextAll('span')[0].innerText;
652				var isDisable = $(target).parents('.c-checkbox').hasClass('is-disable');
653				MAPJS.addFilterStats(myLabel, myName, myValue, isDisable);
654			}
655
656			//セレクトの値を検索条件に追加
657			function scanSelectCombo(target) {
658				var $selectCombo = $(target);
659				var myId = $selectCombo.attr('id');
660				var $minSelect = $selectCombo.find('select').eq(0);
661				var $maxSelect = $selectCombo.find('select').eq(1);
662				var minVal = $minSelect.val();
663				var maxVal = $maxSelect.val();
664				var minText = $minSelect.find('option:selected').text();
665				var maxText = $maxSelect.find('option:selected').text();
666				var defaultMinVal = $minSelect.find('option[data-default]').val();
667				var defaultMaxVal = $maxSelect.find('option[data-default]').val();
668				var title = $selectCombo.data('title');
669
670				if (minVal !== defaultMinVal || maxVal !== defaultMaxVal) {
671					if (maxVal == '-1') {
672						maxText = '';
673					}
674					$selectCombo.parents('.p-searchDrawer__pulldown').find('.js-searcdrawer_pulldown').addClass('has-active');
675					MAPJS.addFilterStats(title + ': ' + minText + ' - ' + maxText, '#' + myId, 'minmax');
676				} else {
677					$selectCombo.parents('.p-searchDrawer__pulldown').find('.js-searc
677drawer_pulldown').removeClass('has-active');
678				}
679			}
680
681			//スライダーの値を検索条件に追加
682			function scanSlider(target) {
683				var $slider = $(target);
684				var $parent = $slider.parents('.p-searchDrawer__pulldown');
685				var minVal = $slider.slider('values', 0);
686				var maxVal = $slider.slider('values', 1);
687				var minSet = $slider.slider('option', 'min');
688				var maxSet = $slider.slider('option', 'max');
689				var currency = $slider.data('currency');
690				var title = $slider.data('title');
691				var includeLowerMin = $parent.find('.js-ext_min').prop('checked');
692				var includeHigherMax = $parent.find('.js-ext_max').prop('checked');
693
694				if (minVal == minSet && maxVal == maxSet && includeLowerMin == true && includeHigherMax == true) {
695					$parent.find('.js-searcdrawer_pulldown').removeClass('has-active');
696					return; //スライダー初期値、min以下&max以上チェック入りは初期値扱い
697				} else {
698					$parent.find('.js-searcdrawer_pulldown').addClass('has-active');
699				}
700
701				//金額と広さでラベルの出力を変更
702				if (target.replace('#', '') !== 'size_drag_area') {
703					MAPJS.addFilterStats(title + ': ' + currency + minVal.toLocaleString() + ' - ' + currency + maxVal.toLocaleString(), target, 'minmax');
704				} else {
705					MAPJS.addFilterStats(title + ': ' + minVal + currency + ' - ' + maxVal + currency, target, 'minmax');
706				}
707
708				//min以下 max以上のチェックボックスを確認
709				$('input[type!=hidden]:checked', $parent).each(function () {
710					scanCheckbox(this);
711				});
712			}
713
714			//statsが空の場合は代替テキストを表示 & SP版の条件変更ボタンに数を表示
715			var statsCount = $('.js-filter_condition a').length;
716			if (statsCount <= 0) {
717				$('.js-filter_condition').html('<span>' + $('.js-filter_condition').data('noresult') + '</span>');
718				$('.js-stats_count').removeAttr('data-count');
719				$('.js-filter_remove_all').removeClass('is-active');
720			} else {
721				$('.js-stats_count').attr('data-count', statsCount);
722				$('.js-filter_remove_all').addClass('is-active');
723			}
724
725
726			//検索条件のremove挙動を再設定
727			MAPJS.initStatsRemove();
728
729			//コンテンツの高さを再設定
730			MAPJS.setHeight();
731		},
732		initStatsRemove: function () {
733			$('.js-filter_remove:not(.has-event)').addClass('has-event').on('click', function () {
734				//value name から対象のinputをuncheck
735				var myName = $(this).data('name');
736				var myValue = $(this).data('value');
737
738				if (myName === '#price_drag_area' || myName === '#size_drag_area') {
739					//スライダー用リセット処理
740					var $slider = $(myName);
741					var $parent = $slider.parents('.p-searchDrawer__slider');
742					var minSet = $slider.slider('option', 'min');
743					var maxSet = $slider.slider('option', 'max');
744
745					$parent.find('.js-ext_min').prop('checked', true).trigger('change');
746					$parent.find('.js-ext_max').prop('checked', true).trigger('change');
747					$slider.slider('values', 0, minSet);
748					$slider.slider('values', 1, maxSet);
749					$parent.find('.min input[type=number]').val(minSet);
750					$parent.find('.max input[type=number]').val(maxSet);
751					$parent.find('.js-searcdrawer_pulldown').removeClass('has-active');
752
753				} else if (myName === 'state_select_id' || myName === 'area_select_id') {
754					//場所UI 都道府県、エリア用
755					if (myName === 'state_select_id') {
756						$('select[name=area_select_id]').find('option').prop('selected', false).change();
757					}
758					$('select[name=' + myName + ']').find('option').prop('selected', false).change();
759				} else if (myName === '.js-multiple') {
760					//場所UI 市区郡用
761					$(myName).multiselect('uncheckAll');
762					$('.ui-multiselect').removeClass('has-active');
763				} else if (myName === '#rent' || myName === '#room_size') {
764					//セレクトコンボ解除用
765					$(myName).find('select').each(function () {
766						var defaultVal = $(this).find('option[data-default]').attr('value');
767						$(this).val(defaultVal);
768					})
769				} else {
770					$('.p-searchDrawer input[name="' + myName + '"][value="' + myValue + '"]').prop('checked', false);
771				}
772
773				//fadeOutアニメーション完了後removeと検索条件を更新
774				$(this).stop(true, true).fadeOut(400, function () {
775					$(this).remove();
776					MAPJS.statsUpdate();
777				})
778
779				reload_init();
780			})
781
782			$('.js-filter_remove_all:not(.has-event)').addClass('has-event').on('click', removeAllFilter);
783
784			function removeAllFilter() {
785				var $items = $('.p-searchmap__stats .js-filter_remove:not(:animated)');
786				$items.each(function () {
787					$(this).trigger('click');
788				})
789				MAPJS.statsUpdate();
790			}
791		},
792		addFilterStats: function (myLabel, myName, myValue, isDisable) {
793			var isDisable = (isDisable) ? 'is-disable' : '';
794			$('.js-filter_condition').append('<a class="js-filter_remove ' + isDisable + '" data-value="' + myValue + '" data-name="' + myName + '">' + myLabel + '</a>');
795			MAPJS.setHeight();
796		},
797		initMapDrag: function () {
798			var interval = null;
799
800			//mapの初期化が終わるまでループ
801			interval = setInterval(function () {
802				if (map) {
803					clearInterval(interval);
804					map.addListener("drag", MAPJS.resetAreaUI);
805				}
806			}, 100);
807		},
808		resetAreaUI: function () {
809			var isUpdate = false;
810			if ($('select[name=state_select_id]').val() !== '') {
811				$('select[name=state_select_id]').find('option').prop('selected', false).change();
812				isUpdate = true;
813			}
814			if ($('select[name=area_select_id]').val() !== '') {
815				$('select[name=area_select_id]').find('option').prop('selected', false).change();
816				$('select[name=state_select_id]').find('option').prop('selected', false).change();
817				isUpdate = true;
818			}
819
820			if ($('.js-multiple').multiselect('value').length > 0) {
821				$('.js-multiple').multiselect('uncheckAll');
822				$('.ui-multiselect').removeClass('has-active');
823				isUpdate = true;
824			}
825
826			if ($("#state_id").val() !== '') {
827				$("#state_id").val("");
828				isUpdate = true;
829			}
830
831			if ($("#area_id").val() !== '') {
832				$("#area_id").val("");
833				isUpdate = true;
834			}
835
836			$('[name="city_id[]"]').map(function (index, checkbox) {
837				$(this).remove();
838			});
839
840
841			if (isUpdate) {
842				//resetボタンを非表示
843				if(document.querySelector('.p-gmap__resetarea:not(.ext-commute)').classList.contains('is-active')){
844					MAPJS.data.resetFlag = false;
845					document.querySelector('.p-gmap__resetarea:not(.ext-commute)').classList.remove('is-active');
846				}
847				MAPJS.statsUpdate();
848			}
849		},
850		resetCommuteUI: function () {
851			var isUpdate = false;
852
853			if( $('input[id=form_station1]').val() !== '' ) {
854				$('input[id=form_station1]').val('');
855				isUpdate = true;
856			}
857			if($('select[id=form_minute1]').prop('selectedIndex') !== 0) {
858				$('select[id=form_minute1]').prop('selectedIndex', 0);
859				isUpdate = true;
860			}
861			if($('select[id=form_nori1]').prop('selectedIndex') !== 0) {
862				$('select[id=form_nori1]').prop('selectedIndex', 0);
863				isUpdate = true;
864			}
865
866			if( $('input[id=form_station2]').val() !== '' ) {
867				$('input[id=form_station2]').val('');
868				isUpdate = true;
869			}
870			if($('select[id=form_minute2]').prop('selectedIndex') !== 0) {
871				$('select[id=form_minute2]').prop('selectedIndex', 0);
872				isUpdate = true;
873			}
874			if($('select[id=form_nori2]').prop('selectedIndex') !== 0) {
875				$('select[id=form_nor2]').prop('selectedIndex', 0);
876				isUpdate = true;
877			}
878
879			$("#commute_minute1").val("");
880			$("#commute_nori1").val("");
881			$("#commute_station1").val("");
882			$("#commute_minute2").val("");
883			$("#commute_nori2").val("");
884			$("#commute_station2").val("");
885
886			if(isUpdate){
887				//resetボタンを非表示
888				if(document.querySelector('.p-gmap__resetarea.ext-commute').classList.contains('is-active')){
889					MAPJS.data.resetFlag = false;
890					document.querySelector('.p-gmap__resetarea.ext-commute').classList.remove('is-active');
891					$('.js-commute').blur();
892				}
893				MAPJS.statsUpdate();
894				reload_init();
895			}
896
897		},
898		initResetAreaButton: function () {
899			$(document).on('click', '.p-gmap__resetarea:not(.ext-commute) a', function () {
900				MAPJS.resetAreaUI();
901				defaultLatLng = map.getCenter();
902				defaultZoom = map.getZoom();
903				reload_init();
904			});
905			$(document).on('click', '.p-gmap__resetarea.ext-commute a', function () {
906				MAPJS.resetCommuteUI();
907				defaultLatLng = map.getCenter();
908				defaultZoom = map.getZoom();
909			});
910		},
911		initOnChange: function () {
912			$(document).on('change', '.p-searchDrawer input, .p-searchDrawer select', function() {
913				MAPJS.statsUpdate();
914				reload_init();
915			})
916		},
917		initWrapperZindex: function () {
918			$(document).on('click', '.js-drawer_open', function () {
919				$('#wrapper').addClass('is-drawerOpen');
920				MAIN.scrollDisable();
921			})
922			$(document).on('click', '.js-drawer_close', function () {
923				$('#wrapper').removeClass('is-drawerOpen');
924				MAIN.scrollAble();
925			})
926		},
927		initSortSelector: function () {
928			$(document).on('change', '.js-sort_selector', function () {
929				var $selectors = $('.js-sort_selector');
930				var flag = true;
931
932				if (this.value !== "") {
933					//セレクタで初期値以外を選択肢た場合に、他のセレクタを初期値にリセット
934					$selectors.not(this).val('').parents('.c-select').removeClass('is-active');
935					$(this).parents('.c-select').addClass('is-active');
936				} else {
937					//自身が初期値かつ他のセレクトもすべて初期値なら、自分の値を必ず1番目の項目を選択
938					$selectors.not(this).each(function () {
939						if (this.value !== "") {
940							flag = false;
941						}
942					})
943					if (flag) {
944						//初期値の次の値を選択
945						$(this).prop('selectedIndex', 1);
946					}
947				}
948			})
949		},
950		initRollUp: function () {
951			$(document).on('click', '.js-rollup', MAPJS.rollUpContent);
952			$(document).on('click', '.js-rollup_content', function () {
953				MAPJS.rollUpContent(true, '.p-searchmap__content', true);
954			});
955		},
956		rollUpContent: function (animation = true, target = null, is_search = false) {
957			var targetPos = null;
958
959			if (target === null) {
960				targetPos = 0;
961			} else {
962				if (window.matchMedia('screen and (max-width: 820px)').matches) {
963					targetPos = $(target).offset().top - $('#header_rwd').outerHeight() - $('.p-searchDrawer__area, .p-searchDrawer__special').outerHeight();
964				} else {
965					targetPos = $(target).offset().top - $('#header_rwd').outerHeight() - $('.c-drawer__content').outerHeight();
966				}
967			}
968
969			if (!animation) {
970				MAIN.$scrollTarget.scrollTop(targetPos);
971			} else {
972				$('body').addClass('is-scroll');
973				if (is_search) {
974					$('body').addClass('is-hoverlock'); // <----【スクロール直前に任意のクラスを付与する】
975				}
976				MAIN.$scrollTarget.stop(true).animate({scrollTop: targetPos}, 400, 'easeInOutQuart', function () {
977					$('body').removeClass('is-scroll');
978					$('body').trigger('scroll');
979				});
980			}
981		},
982		initToggleAll: function () {
983			$(document).on('click', '.js-toggle_allon', function () {
984				toggleAllCheckbox(this, true);
985				reload_init();
986			});
987			$(document).on('click', '.js-toggle_alloff', function () {
988				toggleAllCheckbox(this, false);
989				reload_init();
990			});
991
992			function toggleAllCheckbox(target, toggle) {
993				var $targets = $(target).parents('.p-searchDrawer__title').nextAll('.p-searchDrawer__list').eq(0).find('.c-checkbox:not(.is-disable) input[type=checkbox]');
994				$targets.each(function () {
995					$(this).prop('checked', toggle)
996				})
997			}
998		},
999		initHoverSync: function () {
1000			$('.js-hover_sync').on('mouseover', function (e) {
1001				var myId = ($(e.target).hasClass('js-hover_sync')) ? $(e.target).data('myId') : $(e.target).parents('.js-hover_sync').data('myId');
1002				var targetMarker = marker_list[myId];
1003				/*
1004				for (let i = 0; i < markerArr.length; ++i) {
1005					if(markerArr[i].myId == myId){
1006						targetMarker = markerArr[i];
1007						break;
1008					}
1009				}
1010				*/
1011
1012				if (targetMarker.iconType == 'withlabel') {
1013					targetMarker.label.labelDiv.classList.add('is-hover');
1014				} else {
1015					targetMarker.setIcon('/svg/search/icn-map_circlepin_hover.svg');
1016					if (targetMarker.getMap() !== null) {
1017						targetMarker.setZIndex(1000);
1018					}
1019				}
1020			})
1021			$('.js-hover_sync').on('mouseout', function (e) {
1022				var myId = ($(e.target).hasClass('js-hover_sync')) ? $(e.target).data('myId') : $(e.target).parents('.js-hover_sync').data('myId');
1023				var targetMarker = marker_list[myId];
1024				/*
1025				for (let i = 0; i < markerArr.length; ++i) {
1026					if(markerArr[i].myId == myId){
1027						targetMarker = markerArr[i];
1028						break;
1029					}
1030				}
1031				*/
1032
1033				if (targetMarker.iconType == 'withlabel') {
1034					targetMarker.label.labelDiv.classList.remove('is-hover');
1035				} else {
1036					if (!targetMarker.activeFlag) {
1037						targetMarker.setIcon(targetMarker.defaultIcon);
1038						if (targetMarker.getMap() !== null) {
1039							targetMarker.setZIndex();
1040						}
1041					}
1042				}
1043			})
1044		},
1045		initToggleAccordion: function () {
1046			let $accordions = null;
1047
1048			//PC/SPでアコーディオンを自動で開閉
1049
1050			function checkAccordion() {
1051				if ($('.p-seo .js-accordion:not(.ext-open)').length) {
1052					$accordions = $('.p-seo .js-accordion:not(.ext-open)');
1053					if (MAIN.layout == 'pc') {
1054						$accordions.each(function (me) {
1055							$(this).next().slideDown(0);
1056							$(this).addClass('is-active');
1057						})
1058					} else {
1059						$accordions.each(function () {
1060							$(this).next().slideUp(0);
1061							$(this).removeClass('is-active');
1062						})
1063					}
1064				}
1065				$('.p-seo .js-accordion.ext-open').each(function () {
1066					$(this).next().slideDown(0);
1067					$(this).addClass('is-active');
1068				})
1069			}
1070
1071			let timer = false;
1072
1073			$(window).on('resize', function () {
1074
1075				if (timer !== false) {
1076					clearTimeout(timer);
1077					timer = false;
1078				}
1079
1080				timer = setTimeout(function () {
1081					clearTimeout(timer);
1082					timer = false;
1083					checkAccordion();
1084				}, 200);
1085			});
1086			checkAccordion();
1087		},
1088		initToggleStyle: function () {
1089			$('.js-toggle_style').on('click', function () {
1090				$('.p-searchmap').toggleClass('is-list');
1091				MAPJS.initSlick();
1092				$(window).scrollTop(0);
1093			})
1094		},
1095		initSwitchMap: function () {
1096			$('.p-searchmap__switchmap').on('click', function () {
1097				if($('.p-searchmap').hasClass('is-map')){
1098					$('.p-searchmap').removeClass('is-map');
1099					$('body').removeClass('is-noscroll');
1100				}else{
1101					$('.p-searchmap').addClass('is-map')
1102					$('body').addClass('is-noscroll');
1103				}
1104			});
1105
1106
1107			function checkMediaToggleMapType() {
1108				if(MAIN.layout == 'pc') {
1109					//PCのときはマップ表示
1110					// $('.p-searchmap').addClass('is-map')
1111					$('body').removeClass('is-noscroll');
1112				}else{
1113					//SPのときはリスト表示
1114					//$('.p-searchmap').removeClass('is-map');
1115				}
1116			}
1117
1118			checkMediaToggleMapType();
1119
1120			var timer = false;
1121			$(window).on('resize', function () {
1122				if(timer !== false){
1123					clearTimeout(timer);
1124					timer = false;
1125				}
1126
1127				timer = setTimeout(() => {
1128					clearTimeout(timer);
1129					timer = false;
1130					checkMediaToggleMapType();
1131				}, 300);
1132			});
1133		},
1134		initCheckFullHdToggle: function () {
1135			if (window.matchMedia('screen and (min-width: 1920px)').matches) {
1136				$('.p-searchmap').addClass('is-list');
1137				MAPJS.initSlick();
1138			}
1139		},
1140		initScrollHideObj: function () {
1141			var $content = $('.p-searchmap__content');
1142			var $target = $('.p-searchmap__error, .p-searchmap__toggle, .p-searchmap__switchmap, .p-search__drawer, .p-gmap__resetarea');
1143
1144			$(window).off('scroll', toggleObj);
1145			$(window).on('scroll', toggleObj);
1146			toggleObj();
1147
1148			function toggleObj() {
1149				var scrollPos = $(window).scrollTop();
1150				var pos = $content.outerHeight() + $content.offset().top;
1151				if (!window.matchMedia('screen and (max-width: 820px)').matches) {
1152					if (scrollPos > pos) {
1153						$target.addClass('is-disable');
1154					} else {
1155						$target.removeClass('is-disable');
1156					}
1157				} else {
1158
1159				}
1160			}
1161		},
1162		initPopularFilter: function () {
1163			var endEventName = "webkitTransitionEnd mozTransitionEnd oTransitionEnd transitionend";
1164			$link = $('.js-popular_filter');
1165
1166			$link.on('click', function (params) {
1167				var myName = null;
1168				var myId = null;
1169				var myText = null;
1170				var $target = null;
1171
1172				if($(this).data('name')){
1173					myName = $(this).data('name').replace('[]','');
1174				}else{
1175					myId = $(this).data('id');
1176				}
1177				var myText = $(this).data('text');
1178				var myValue = $(this).data('value');
1179				var isCheckbox = null;
1180
1181				if (myName !== null) {
1182					$target = $('[name^=' + myName + '][value=' + myValue + ']');
1183					$target.prop('checked', true);
1184					isCheckbox = true;
1185				} else {
1186					$target = $('#' + myId);
1187					$target.val(myValue);
1188					isCheckbox = false;
1189				}
1190
1191				if (!window.matchMedia('screen and (max-width: 820px)').matches) {
1192					pcPopularAnimation();
1193				} else {
1194					//ドロワ開閉挙動
1195					$('.js-drawer_open').trigger('click');
1196
1197					//ドロワアニメーション後、スクロール
1198					$('.p-search__drawer').on(endEventName, smpPopularAnimation)
1199				}
1200
1201				function pcPopularAnimation() {
1202					//アニメーション
1203					var $parents = $target.parents('.p-searchDrawer__pulldown');
1204					var targetT = $parents.offset().top;
1205					var targetL = $parents.offset().left;
1206					var targetW = $parents.outerWidth();
1207					var targetH = $parents.outerHeight();
1208					var scale = 1.75;
1209
1210					$('body').append('<div class="ripple"></div>');
1211
1212					$('.ripple').css({
1213						width: targetW + 'px',
1214						height: targetH + 'px',
1215						top: (targetT + targetH / 2) + 'px',
1216						left: (targetL + targetW / 2) + 'px',
1217						opacity: 1
1218					}).animate({
1219						width: targetW * scale + 'px',
1220						height: targetH * scale + 'px',
1221						opacity: 0,
1222						backgroundColor: '#fff'
1223					}, 400, 'linear', function () {
1224						$(this).remove();
1225					})
1226
1227					//ポップアップ
1228					MAPTIP.show($parents, myText);
1229				}
1230
1231				function smpPopularAnimation() {
1232					var targetTop = null;
1233
1234					$(this).off(endEventName, smpPopularAnimation);
1235
1236					//checkbox・select判定
1237					if (isCheckbox) {
1238						targetTop = $target.parents('label').offset().top - $('.c-drawer__header').outerHeight() * 2;
1239					} else {
1240						targetTop = $target.offset().top - $('.c-drawer__header').outerHeight() * 2;
1241					}
1242
1243					$('.c-drawer__content').addClass('is-scroll');
1244					$('.c-drawer__content').stop(true, true).animate({
1245						scrollTop: targetTop + 'px'
1246					}, 600, 'easeInOutQuart', function () {
1247						//ポップアップ
1248						MAPTIP.show($target, myText);
1249						setTimeout(() => {
1250							$('.c-drawer__content').removeClass('is-scroll');
1251						}, 100);
1252					});
1253				}
1254
1255
1256				MAPJS.checkHasActive();
1257				reload_init();
1258			})
1259
1260			//人気の条件がある場合はSPでのspecialの影をオフ
1261			if ($('.p-searchDrawer__popular').length) {
1262				$('.p-searchDrawer__special, .p-searchDrawer__area').addClass('has-popular');
1263			}
1264		},
1265		scrollToContent: function (animate) {
1266			if (!window.matchMedia('screen and (max-width: 820px)').matches) return;
1267			var $content = $('.p-searchmap__content');
1268			if (!$content.length) return;
1269			var targetPos = $content.offset().top - ($(window).height() - $('.p-gmap').outerHeight());
1270			if (animate === false) {
1271				$(window).scrollTop(targetPos);
1272			} else {
1273				$('html, body').stop(true).animate({ scrollTop: targetPos }, 400, 'easeInOutQuart');
1274			}
1275			$('.p-searchmap__checkfilter').removeClass('is-active');
1276		}
1277	}
1278	MAPJS.init();
1279
1280	MAPTIP = {
1281		target: null,
1282		timer: null,
1283		show: function (target, alertMsg, alert) {
1284			var $tip;
1285			var $addParent = null;
1286
1287			clearTimeout(MAPTIP.timer);
1288
1289			$('.p-searchmap__baloon').remove();
1290			MAPTIP.target = $(target);
1291
1292			if(window.matchMedia('screen and (max-width: 820px)').matches){
1293				if(alert) {
1294					$addParent = $('body');
1295					MAPTIP.target = $('li.ext-freeword, .js-searcdrawer_pulldown.ext-commute');
1296				}else{
1297					$addParent = $('.p-searchDrawer');
1298					MAPTIP.target = $(target).parents('li');
1299				}
1300			}else{
1301				$addParent = $('body');
1302			}
1303
1304			$addParent.append('<div class="p-searchmap__baloon"><p>'+alertMsg+'</p></div>');
1305			$tip = $('.p-searchmap__baloon');
1306
1307
1308			MAPTIP.onResize();
1309			$tip.addClass('is-active');
1310			$(window).on('scroll', windowScrollFunc);
1311			$(window).on('resize', MAPTIP.onResize );
1312			$('.c-drawer__content').on('scroll', scrollFunc );
1313
1314			if(!alert) {
1315				MAPTIP.timer = setTimeout(() => {
1316					MAPTIP.hide();
1317				}, 3000);
1318			}else{
1319				$tip.addClass('is-alert');
1320			}
1321
1322			function windowScrollFunc() {
1323				//alert削除用
1324				$(window).off('scroll', windowScrollFunc);
1325				MAPTIP.hide();
1326			}
1327
1328			function scrollFunc() {
1329				if(!$('.c-drawer__content').hasClass('is-scroll')){
1330					MAPTIP.hide();
1331				}
1332			}
1333
1334		},
1335		hide: function (e) {
1336			MAPTIP.target = null;
1337			$(window).off('resize', MAPTIP.onResize );
1338			$('.c-drawer__content').off('scroll' );
1339			$('.p-searchmap__baloon').remove();
1340		},
1341		onResize: function (e, args) {
1342			var $target = MAPTIP.target;
1343			$tip = $('.p-searchmap__baloon');
1344
1345			var myH = $target.outerHeight();
1346			var myW = $target.outerWidth();
1347			var myX = $target.offset().left;
1348			var myY = $target.offset().top;
1349			var tipW = $('.p-searchmap__baloon').outerWidth();
1350			var tipH = $('.p-searchmap__baloon').outerHeight();
1351			var leftPos = 0;
1352			var windowW = $(window).innerWidth();
1353			var overW = 0;
1354
1355			if(myX < windowW /2) {
1356				//左寄せパターン
1357				if( myX + tipW + 15  > windowW) {
1358					overW = (myX + tipW + 15) - windowW;
1359					leftPos = myX - overW;
1360				}else{
1361					leftPos = myX
1362				}
1363			}else{
1364				//右寄せパターン
1365				leftPos = (myX + myW) - tipW;
1366				$tip.addClass('ext-right');
1367			}
1368
1369			//右パターンで画面外にはみ出る防止
1370			if( leftPos < 15 ) {
1371				leftPos = 15;
1372			}
1373
1374			$tip.css('top', (myY-tipH)+'px');
1375			$tip.css('left', leftPos+'px');
1376
1377		}
1378	}
1379
1380	//MarketPrice
1381	MKTPRCJS = {
1382		init: function() {
1383			var maxPrice = 0;
1384			$('.js-marketprice').each(function () {
1385				//最大値を設定
1386				$(this).find('tr').each(function () {
1387					var myVal = $(this).find('.ext-graph div:not(.ext-alt)').data('price');
1388					if(myVal > maxPrice) {
1389						maxPrice = myVal;
1390					}
1391
1392					var myValAlt = $(this).find('.ext-graph div.ext-alt').data('price');
1393					if(myValAlt > maxPrice) {
1394						maxPrice = myValAlt;
1395					}
1396				});
1397
1398				//最大値を元にグラフの長さを生成
1399				$(this).find('tr').each(function () {
1400					var myVal = $(this).find('.ext-graph div:not(.ext-alt)').data('price');
1401					$(this).find('.ext-graph div:not(.ext-alt)').css('width', myVal/maxPrice*100+'%');
1402
1403					var myValAlt = $(this).find('.ext-graph div.ext-alt').data('price');
1404					$(this).find('.ext-graph div.ext-alt').css('width', myValAlt/maxPrice*100+'%');
1405				});
1406			})
1407		}
1408	}
1409	MKTPRCJS.init();
1410});

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.