<!DOCTYPE html>
<html lang="ko"
	xmlns:th="http://www.thymeleaf.org">
<!--
 *******************************************************************************
 * @source  : lnb.html
 * @desc    : Left Menu
 *============================================================================
 * STYLE24
 * Copyright(C) 2020 TSIT, All rights reserved.
 *============================================================================
 * VER  DATE         AUTHOR      DESCRIPTION
 * ===  ===========  ==========  =============================================
 * 1.0  2020.10.06   gagamel     최초 작성
 *******************************************************************************
 -->
<body>

<div th:fragment="lnb" id="lnb-wrapper">
	<ul id="lnb" class="lnb">

	</ul>

<script th:inline="javascript">
/*<![CDATA[*/
	// LNB 메뉴 클릭 시
	let fnClickLnb = function(menuId) {
		let menu = cfnGetMenuInfo(menuId);

		// Menu 정보가 없으면 skip
		if (typeof(menu) == 'undefined') {
			return;
		}
		
		$('#content').load(menu.menuUrl, function() {
			// Content Main Title
			let arrNavigation = menu.navigation.split(' > ');
			let contentTitle = '';
			contentTitle += '<h1>' + (arrNavigation.length > 2 ? arrNavigation[2] : (arrNavigation.length > 1 ? arrNavigation[1] : arrNavigation[0])) + '</h1>\n';
			contentTitle += '<ol>\n';
			contentTitle += '	<li><i class="fa fa-home"></i> <a>' + arrNavigation[0] + '</a></li>\n';
			if (arrNavigation.length > 1) {
				contentTitle += '	<li><a>' + arrNavigation[1] + '</a></li>\n';
			}
			if (arrNavigation.length > 2) {
				contentTitle += '	<li><a>' + arrNavigation[2] + '</a></li>\n';
			}
			contentTitle += '</ol>\n';
			$('.main-title').html(contentTitle);
			
			if (!gagajf.isNull(menu.menuDesc)) {
				$('.menu-desc').html(menu.menuDesc);
				if ($('.menu-desc').length > 0) $('.menu-desc').show();
			} else {
				if ($('.menu-desc').length > 0) $('.menu-desc').hide();
			}
			
			$('.schDate').datepicker({
				changeMonth: true,
				changeYear: true,
				defaultDate: $('.schDate').val()
			});

			let currentYear = (new Date()).getFullYear();
			let startYear = currentYear - 10;
			let finalYear = currentYear + 10;
			let options = {
				startYear: startYear,
				finalYear: finalYear,
				pattern: 'yyyy-mm',
				monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월']
			};
			$('.schMonth').monthpicker(options);

			//조회폼에서 엔터키 입력시 자동조회
			if ($('#btnSearch').length == 1) {
				$("#main").find("form:first").on('keyup', function(e) {
					if (e.keyCode == 13) {
						if ($('#btnSearch').length == 1) {
							$('#btnSearch').click();
						}
					}
				})
			}
		});
		$(window).scrollTop(0);
	}

	$(document.body).ready(function() {

	});
/*]]>*/
</script>

</div>

</body>
</html>