PageSourceSearch

https://www.777english.co.kr/js/mobile_menu.js?1724648860

js 777english.co.kr collected 2026-10-01 15:32:27 UTC 15,441 bytes, 581 lines download raw bytes

1var MOBILE_SLIDE_MENU = function(){
2	var $menu_slide;
3	var $menu_container;
4	var $body;
5	var status;
6	var $backdrop;
7	var open_class = 'slide_open';
8	var backdrop_class = 'slide_menu_backdrop';
9	var init = function(){
10		$body = $('body');
11		$menu_container = $('#mobile_slide_menu_wrap');
12		$menu_slide = $('#mobile_slide_menu');
13
14		var data = $body.data('slide_menu');
15		if(typeof  data == 'undefined') {
16			$body.data('slide_menu','N');
17			status = false;
18		}
19
20		$(window).on("resize", function () {
21			if(!$body.hasClass('admin')){
22				status = $body.data('slide_menu')=='Y';
23				if ($(window).width() > 767 && status) {
24					slideNavToggle();
25				}
26			}
27		});
28		runAccordion();
29		// menuActivate();
30	};
31
32	var set_accordion = false;
33	var active_list = {};
34	var runAccordion = function(){
35		var transitioning = null;
36
37		var show = function ($el) {
38			if (transitioning || $el.hasClass('in')) return;
39
40			var dimension = 'height';
41
42			$el
43				.show()
44				.removeClass('collapse')
45				.addClass('collapsing')[dimension](0)
46				.attr('aria-expanded', true);
47
48			//활성화 메뉴 리스트에 추가
49			active_list[$el.attr('data-index')] = $el;
50
51			transitioning = 1;
52
53			var complete = function () {
54				$el
55					.removeClass('collapsing')
56					.addClass('collapse in')[dimension]('');
57				transitioning = 0;
58			};
59
60
61			var scrollSize = $.camelCase(['scroll', dimension].join('-'));
62
63			$el
64				.one('bsTransitionEnd', $.proxy(complete, this))
65				.emulateTransitionEnd(350)[dimension]($el[0][scrollSize]);
66		};
67		var hide = function ($el) {
68			if (transitioning || !$el.hasClass('in')) return;
69
70			var dimension = 'height';
71
72			$el[dimension]($el[dimension]())[0].offsetHeight;
73
74			$el
75				.addClass('collapsing')
76				.removeClass('collapse in')
77				.attr('aria-expanded', false);
78
79			// 메뉴를 접을 때 하위 메뉴도 모두 접기 처리
80			var $el_li = $el.children('li');
81			var $el_li_a = $el_li.children('a');
82			if($el_li_a.hasClass('has_child')){
83				hide($el_li.children('ul'));
84				$el_li_a.toggleClass('open', false);
85			}
86
87			transitioning = 1;
88
89			var complete = function () {
90				transitioning = 0;
91				$el
92					.removeClass('collapsing')
93					.addClass('collapse')
94					.hide();
95
96				//메뉴서랍 숨기기
97				$el.find('ul').hide();
98				//활성화 메뉴 리스트에서 제거
99				delete active_list[$el.attr('data-index')];
100
101			};
102
103			$el
104				[dimension](0)
105				.one('bsTransitionEnd', $.proxy(complete, this))
106				.emulateTransitionEnd(350);
107		};
108
109
110		if(!set_accordion){
111			$menu_slide.find('a').each(function(i){
112				var $that = $(this);
113				var $parent_li = $that.parent('li');
114				var has_child = $that.data('has_child')=='Y' && $that.parent('li').children('ul').children('li:not(.pms_check)').length > 0;
115				if($that.hasClass('active')){
116					if(has_child){
117						var $child_ul = $parent_li.children('ul');
118						var $child_ul_li = $child_ul.children('li:not(.pms_check)');
119						$child_ul.attr('data-index',i);
120					}
121					if(has_child && $child_ul_li.length>0){
122						$child_ul.show();
123						$child_ul.toggleClass('in', true);
124						$that.toggleClass('open', true);
125						$that.toggleClass('has_child', true);
126
127						active_list[i] = $child_ul;
128					}
129				}else{
130					var $child_ul = $parent_li.children('ul');
131					var $child_ul_li = $child_ul.children('li:not(.pms_check)');
132					$child_ul.height(0);
133					if(has_child && $child_ul_li.length>0){
134						$that.toggleClass('has_child', true);
135					}
136					$child_ul.attr('data-index',i);
137				}
138				$that.off('click').on('click',function(e){
139					var $parent_li = $that.parent('li');
140					var is_folder_menu = $that.data('is_folder_menu')=='Y';
141					var has_child = $that.data('has_child')=='Y' && $that.parent('li').children('ul').children('li:not(.pms_check)').length > 0;
142					if(has_child){
143						var $child_ul = $parent_li.children('ul');
144						var $child_ul_li = $child_ul.children('li:not(.pms_check)');
145					}
146
147					if(has_child && $child_ul_li.length>0){
148						if(is_folder_menu || $(e.target).hasClass('_toggle_btn')){
149							var $child_ul = $parent_li.children('ul');
150							var child_height = 0;
151							$child_ul.children('li:not(.pms_check)').each(function(){
152								child_height += $that.outerHeight();
153							});
154							if($child_ul.hasClass('in')){
155								hide($child_ul);
156								$that.toggleClass('open', false);
157							}else{
158								$that.toggleClass('open', true);
159								show($child_ul);
160							}
161							cancelPropagation(e);
162							return false;
163						}
164					}else{
165						slideNavToggle();
166					}
167				});
168
169			});
170		}
171
172	};
173
174	var rebuildAccordion = function(){
175		$menu_slide.find('a').each(function(i){
176			var $that = $(this);
177			var $parent_li = $that.parent('li');
178			var has_child = $that.data('has_child')=='Y' && $that.parent('li').children('ul').children('li:not(.pms_check)').length > 0;
179			if(has_child){
180				var $child_ul = $parent_li.children('ul');
181				var $child_ul_li = $child_ul.children('li:not(.pms_check)');
182			}
183			if(has_child && $child_ul_li.length>0){
184				$that.toggleClass('has_child', true);
185			}
186		});
187	};
188
189	var slideNavToggle = function($obj){
190		if(typeof $obj == 'object'){
191			var $colgroup = $obj.closest('div[data-type=col-group]');
192			var colgroup = $colgroup.attr('data-col-group');
193			if(colgroup == 'right'){
194				$menu_container.toggleClass('left-slide', false);
195				$menu_container.toggleClass('right-slide', true);
196			}else{
197				$menu_container.toggleClass('right-slide', false);
198				$menu_container.toggleClass('left-slide', true);
199			}
200			$menu_slide.toggleClass('animation',true);
201		}
202		status = $body.data('slide_menu')=='Y';
203
204		if(status){
205			hideSlide();
206		} else{
207			showSlide();
208		}
209
210	};
211
212	var showSlide = function(){
213
214		//활성화되어있는 메뉴 보이도록 처리
215		for(var k in active_list){
216			if(active_list[k].length > 0){
217				if(active_list[k].css('display') === 'none') active_list[k].show();
218			}
219		}
220
221		$('#'+backdrop_class).remove();
222		$backdrop = $('<div id="'+backdrop_class+'"/>').addClass(backdrop_class).on('click',function(){
223			slideNavToggle();
224		});
225		$body.data('slide_menu','Y');
226		$body.css('overflow-y','hidden');
227		setTimeout(function() {
228			$menu_container.width('100%');
229		},10);
230		$menu_container.prepend($backdrop);
231		$menu_slide.before();
232		$menu_container.toggleClass(open_class, true);
233	};
234
235	var hideSlide = function(){
236		$body.data('slide_menu','N');
237		var is_fullpage = $body.find('.visual_section').attr('doz_fullpage') ==='Y';
238		if(is_fullpage)
239			$body.css('overflow-y','hidden');
240		else
241			$body.css('overflow-y','auto');
242		$backdrop.remove();
243		setTimeout(function(){
244			$body.data('slide_menu','N');
245			if(is_fullpage)
246				$body.css('overflow-y','hidden');
247			else
248				$body.css('overflow-y','auto');
249			$menu_container.width(0);
250			$menu_container.toggleClass(open_class,false);
251			$('#'+backdrop_class).remove();
252
253			//열려있는 메뉴서랍 숨기기
254			$menu_slide.find('.depth-01 ul').hide();
255		},700);
256		$menu_container.toggleClass(open_class,false);
257	};
258
259	// var menuActivate = function(){
260	// 	var url = window.location.href;
261	// 	var url_id = url.split('/').splice(-1);
262	//
263	// 	$menu_slide.find('a').each(function(){
264	// 		var $that = $(this);
265	// 		var $parent_li = $that.parent('li');
266	// 		var has_child = $that.data('has_child')=='Y' && $parent_li.children('ul').children('li:not(.pms_check)').length > 0;
267	//
268	// 		if ( url_id[0] ==  $that.data('url') ) {
269	// 			$that.toggleClass('active-real', true);
270	// 		}
271	//
272	// 		var active_child = $parent_li.children('ul').children('li').children('a');
273	//
274	// 		setTimeout(function(){
275	// 			if( has_child && active_child.hasClass('active-real') ){
276	// 				$parent_li.children('ul').show().css('height', 'auto');
277	// 				$that.toggleClass('active open', true);
278	// 				$that.siblings('a.has_child').toggleClass('active open', true);
279	// 			}
280	// 		}, 100);
281	//
282	// 	});
283	// };
284
285	return {
286		'init' :function(){
287			init();
288		},
289		'rebuildAccordion': function(){
290			rebuildAccordion();
291		},
292		'slideNavToggle' : function($obj){
293			slideNavToggle($obj);
294		},
295		'hideSlide' : function(){
296			hideSlide();
297		},
298		'showSlide' : function(){
299			showSlide();
300		}
301		// ,
302		// 'menuActivate' : function(){
303		// 	menuActivate();
304		// }
305	};
306
307}();
308var PC_SLIDE_MENU = function(){
309	var $menu_slide;
310	var $menu_container;
311	var $body;
312	var status;
313	var $backdrop;
314	var open_class = 'slide_open';
315	var backdrop_class = 'slide_menu_backdrop';
316	var init = function(){
317		$body = $('body');
318		$menu_container = $('#pc_slide_menu_wrap');
319		$menu_slide = $('#pc_slide_menu');
320
321		var data = $body.data('pc_slide_menu');
322		if(typeof  data == 'undefined') {
323			$body.data('pc_slide_menu','N');
324			status = false;
325		}
326
327		$(window).on("resize", function () {
328			status = $body.data('pc_slide_menu')=='Y';
329			if ($(window).width() <= 767 && status) {
330				slideNavToggle();
331			}
332		});
333		runAccordion();
334
335		$menu_slide.find('._tse_scrollable').TrackpadScrollEmulator();
336	};
337
338	var set_accordion = false;
339	var active_list = {};
340	var runAccordion = function(){
341		var transitioning = null;
342
343		var show = function ($el) {
344			if (transitioning || $el.hasClass('in')) return;
345
346			var dimension = 'height';
347
348			$el
349				.show()
350				.removeClass('collapse')
351				.addClass('collapsing')[dimension](0)
352				.attr('aria-expanded', true);
353
354			//활성화 메뉴 리스트에 추가
355			active_list[$el.attr('data-index')] = $el;
356
357			transitioning = 1;
358
359			var complete = function () {
360				$el
361					.removeClass('collapsing')
362					.addClass('collapse in')[dimension]('');
363				transitioning = 0;
364			};
365
366
367			var scrollSize = $.camelCase(['scroll', dimension].join('-'));
368
369			$el
370				.one('bsTransitionEnd', $.proxy(complete, this))
371				.emulateTransitionEnd(350)[dimension]($el[0][scrollSize]);
372		};
373		var hide = function ($el) {
374			if (transitioning || !$el.hasClass('in')) return;
375
376			var dimension = 'height';
377
378			$el[dimension]($el[dimension]())[0].offsetHeight;
379
380			$el
381				.addClass('collapsing')
382				.removeClass('collapse in')
383				.attr('aria-expanded', false);
384
385			// 메뉴를 접을 때 하위 메뉴도 모두 접기 처리
386			var $el_li = $el.children('li');
387			var $el_li_a = $el_li.children('a');
388			if($el_li_a.hasClass('has_child')){
389				hide($el_li.children('ul'));
390				$el_li_a.toggleClass('open', false);
391			}
392
393			transitioning = 1;
394
395			var complete = function () {
396				transitioning = 0;
397				$el
398					.removeClass('collapsing')
399					.addClass('collapse')
400					.hide();
401
402				//메뉴서랍 숨기기
403				$el.find('ul').hide();
404				//활성화 메뉴 리스트에서 제거
405				delete active_list[$el.attr('data-index')];
406
407			};
408
409			$el
410				[dimension](0)
411				.one('bsTransitionEnd', $.proxy(complete, this))
412				.emulateTransitionEnd(350);
413		};
414
415
416		if(!set_accordion){
417			$menu_slide.find('a').each(function(i){
418				var $that = $(this);
419				var $parent_li = $that.parent('li');
420				var has_child = $that.data('has_child')=='Y' && $that.parent('li').children('ul').children('li:not(.pms_check)').length > 0;
421				if($that.hasClass('active')){
422					if(has_child){
423						var $child_ul = $parent_li.children('ul');
424						var $child_ul_li = $child_ul.children('li:not(.pms_check)');
425						$child_ul.attr('data-index',i);
426					}
427					if(has_child && $child_ul_li.length>0){
428						$child_ul.show();
429						$child_ul.toggleClass('in', true);
430						$that.toggleClass('open', true);
431						$that.toggleClass('has_child', true);
432
433						active_list[i] = $child_ul;
434					}
435				}else{
436					var $child_ul = $parent_li.children('ul');
437					var $child_ul_li = $child_ul.children('li:not(.pms_check)');
438					$child_ul.height(0);
439					if(has_child && $child_ul_li.length>0){
440						$that.toggleClass('has_child', true);
441					}
442					$child_ul.attr('data-index',i);
443				}
444				$that.off('click').on('click',function(e){
445					var $parent_li = $that.parent('li');
446					var is_folder_menu = $that.data('is_folder_menu')=='Y';
447					var has_child = $that.data('has_child')=='Y' && $that.parent('li').children('ul').children('li:not(.pms_check)').length > 0;
448					if(has_child){
449						var $child_ul = $parent_li.children('ul');
450						var $child_ul_li = $child_ul.children('li:not(.pms_check)');
451					}
452
453					if(has_child && $child_ul_li.length>0){
454						if(is_folder_menu || $(e.target).hasClass('_toggle_btn')){
455							var $child_ul = $parent_li.children('ul');
456							var child_height = 0;
457							$child_ul.children('li:not(.pms_check)').each(function(){
458								child_height += $that.outerHeight();
459							});
460							if($child_ul.hasClass('in')){
461								hide($child_ul);
462								$that.toggleClass('open', false);
463							}else{
464								$that.toggleClass('open', true);
465								show($child_ul);
466							}
467							cancelPropagation(e);
468							return false;
469						}
470					}else{
471						slideNavToggle();
472					}
473				});
474
475			});
476		}
477
478	};
479
480	var rebuildAccordion = function(){
481		$menu_slide.find('a').each(function(i){
482			var $that = $(this);
483			var $parent_li = $that.parent('li');
484			var has_child = $that.data('has_child')=='Y' && $that.parent('li').children('ul').children('li:not(.pms_check)').length > 0;
485			if(has_child){
486				var $child_ul = $parent_li.children('ul');
487				var $child_ul_li = $child_ul.children('li:not(.pms_check)');
488			}
489			if(has_child && $child_ul_li.length>0){
490				$that.toggleClass('has_child', true);
491			}
492		});
493	};
494
495	var slideNavToggle = function($obj){
496		if(typeof $obj == 'object'){
497			var $colgroup = $obj.closest('div[data-type=col-group]');
498			var colgroup = $colgroup.attr('data-col-group');
499			if(colgroup == 'right'){
500				$menu_container.toggleClass('left-slide', false);
501				$menu_container.toggleClass('right-slide', true);
502			}else{
503				$menu_container.toggleClass('right-slide', false);
504				$menu_container.toggleClass('left-slide', true);
505			}
506			$menu_slide.toggleClass('animation',true);
507		}
508		status = $body.data('pc_slide_menu')=='Y';
509		if(status){
510			hideSlide();
511		} else{
512			showSlide();
513		}
514	};
515
516	var showSlide = function(){
517		//활성화되어있는 메뉴 보이도록 처리
518		for(var k in active_list){
519			if(active_list[k].length > 0){
520				if(active_list[k].css('display') === 'none') active_list[k].show();
521			}
522		}
523		$('#'+backdrop_class).remove();
524		$backdrop = $('<div id="'+backdrop_class+'"/>').addClass(backdrop_class).on('click',function(){
525			slideNavToggle();
526		});
527		$body.data('pc_slide_menu','Y');
528		$body.css('overflow-y','hidden');
529		setTimeout(function() {
530			$menu_container.width('100%');
531		},10);
532		$menu_container.prepend($backdrop);
533		$menu_slide.before();
534		$menu_container.toggleClass(open_class, true);
535	};
536
537	var hideSlide = function(){
538		$body.data('pc_slide_menu','N');
539		$backdrop.remove();
540		var is_fullpage = $body.find('.visual_section.pc_section').attr('doz_fullpage') ==='Y';
541		if(is_fullpage)
542			$body.css('overflow-y','hidden');
543		else
544			$body.css('overflow-y','auto');
545		setTimeout(function(){
546			$body.data('pc_slide_menu','N');
547			if(is_fullpage)
548				$body.css('overflow-y','hidden');
549			else
550				$body.css('overflow-y','auto');
551			$menu_container.width(0);
552			$menu_container.toggleClass(open_class,false);
553			$('#'+backdrop_class).remove();
554		},700);
555		$menu_container.toggleClass(open_class,false);
556	};
557
558
559	return {
560		'init' :function(){
561			init();
562		},
563		'rebuildAccordion': function(){
564			rebuildAccordion();
565		},
566		'slideNavToggle' : function($obj){
567			slideNavToggle($obj);
568		},
569		'hideSlide' : function(){
570			hideSlide();
571		},
572		'showSlide' : function(){
573			showSlide();
574		}
575	};
576
577}();
578$(function(){
579	MOBILE_SLIDE_MENU.init();
580	PC_SLIDE_MENU.init();
581});

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.