You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
3.8 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. /***********************************************************************************
  2. * 관리자 페이지 초기화
  3. ***********************************************************************************/
  4. APP.init = function(){
  5. APP.initMenu();
  6. APP.initAx5();
  7. APP.initPlugins();
  8. APP.initFitHeight();
  9. DevExpress.localization.locale('ko');
  10. };
  11. /***********************************************************************************
  12. * 메뉴관련 초기화
  13. ***********************************************************************************/
  14. APP.initMenu = function(){
  15. $('#nav .main-navigation li').each(function(){
  16. var $this = $(this);
  17. var menuCode = $this.data('active');
  18. if(menuCode == menuActive)
  19. {
  20. $(this).addClass('active');
  21. $(this).parents('li').addClass('active');
  22. }
  23. });
  24. };
  25. APP.initPlugins = function() {
  26. $.datepicker._updateDatepicker_original = $.datepicker._updateDatepicker;
  27. $.datepicker._updateDatepicker = function(inst) {
  28. $.datepicker._updateDatepicker_original(inst);
  29. var afterShow = this._get(inst, 'afterShow');
  30. if (afterShow)
  31. afterShow.apply((inst.input ? inst.input[0] : null));
  32. }
  33. $.datepicker.regional['ko'] = {
  34. closeText: '닫기',
  35. prevText: '이전달',
  36. nextText: '다음달',
  37. currentText: '오늘',
  38. monthNames: ['1월','2월','3월','4월','5월','6월', '7월','8월','9월','10월','11월','12월'],
  39. monthNamesShort: ['1월','2월','3월','4월','5월','6월', '7월','8월','9월','10월','11월','12월'],
  40. dayNames: ['일','월','화','수','목','금','토'],
  41. dayNamesShort: ['일','월','화','수','목','금','토'],
  42. dayNamesMin: ['일','월','화','수','목','금','토'],
  43. weekHeader: 'Wk',
  44. dateFormat: 'yy-mm-dd',
  45. firstDay: 0,
  46. isRTL: false,
  47. showMonthAfterYear: true,
  48. changeMonth: true,
  49. changeYear: true,
  50. yearSuffix: ''
  51. };
  52. $.datepicker.setDefaults($.datepicker.regional['ko']);
  53. $('[data-toggle="datepicker"]').each(function(){
  54. $(this).datepicker();
  55. if( typeof $(this).data('chained-datepicker') != 'undefined' && $(this).data('chained-datepicker') )
  56. {
  57. var el = $(this).data('chained-datepicker'),
  58. $el = $(el);
  59. if($el.length > 0 ) {
  60. $(this).change(function() {
  61. if($el.hasClass('hasDatepicker')) {
  62. $el.datepicker('option', 'minDate', $(this).val() );
  63. }
  64. })
  65. }
  66. }
  67. });
  68. $("body").on("click", '[data-toggle="datepicker"]', function(){
  69. if (!$(this).hasClass("hasDatepicker"))
  70. {
  71. $(this).datepicker();
  72. $(this).datepicker("show");
  73. }
  74. });
  75. };
  76. /**********************************************************************************************************************
  77. * MODAL 관련
  78. *********************************************************************************************************************/
  79. APP.initAx5 = function(){
  80. APP.MASK = new ax5.ui.mask({
  81. zIndex: 1000}
  82. );
  83. APP.MASK2 = new ax5.ui.mask({
  84. zIndex: 2000
  85. });
  86. APP.modal = new ax5.ui.modal({
  87. absolute: true,
  88. iframeLoadingMsg: '<i class="far fa-spinner"></i>'
  89. });
  90. APP.modal2 = new ax5.ui.modal({
  91. absolute: true,
  92. iframeLoadingMsg: '<i class="far fa-spinner"></i>'
  93. });
  94. };
  95. APP.initFitHeight = function() {
  96. $(window).resize(function() {
  97. if($('[data-fit-content]').length> 0 )
  98. {
  99. var mH = $('#contents').height();
  100. $('[data-fit-aside]').each(function() {
  101. mH -= $(this).height();
  102. });
  103. $('[data-fit-content]').height(mH);
  104. }
  105. }).resize();
  106. };
  107. $(function(){
  108. APP.init();
  109. });