@@ -69,6 +69,96 @@ <h1>제목</h1>
6969
7070 < script >
7171
72+ /////////////////////////////////////////////////////////////////////////////
73+ //===========================================================================
74+ function initializePageResizer ( ) {
75+ const resizer = document . getElementById ( "page-resizer" ) ;
76+ const left = document . getElementById ( "page-information" ) ;
77+ if ( ! resizer ) {
78+ return ;
79+ }
80+ if ( ! left ) {
81+ return ;
82+ }
83+
84+
85+ let isResizing = false ;
86+
87+
88+ resizer . addEventListener ( 'mousedown' ,
89+ function ( e ) {
90+ isResizing = true ;
91+ document . body . style . cursor = 'ew-resize' ;
92+
93+ document . body . style . userSelect = 'none' ; // 텍스트 선택 방지
94+ }
95+ ) ;
96+
97+ document . addEventListener ( 'mousemove' ,
98+ function ( e ) {
99+ const leftMinSize = 300 ;
100+
101+ if ( ! isResizing ) return ;
102+ const newWidth = e . clientX - left . getBoundingClientRect ( ) . left ;
103+ if ( newWidth > leftMinSize && newWidth < window . innerWidth * 0.8 ) {
104+ left . style . width = newWidth + 'px' ;
105+ }
106+ }
107+ ) ;
108+
109+ document . addEventListener ( 'mouseup' ,
110+ function ( ) {
111+ if ( isResizing ) {
112+ document . body . style . cursor = '' ;
113+
114+ document . body . style . userSelect = '' ; // 텍스트 선택 방지 원래대로 복원
115+ }
116+
117+ isResizing = false ;
118+ }
119+ ) ;
120+ }
121+
122+ function setPageResizerHeight ( ) {
123+ const resizer = document . getElementById ( "page-resizer" ) ;
124+ if ( ! resizer ) {
125+ return ;
126+ }
127+
128+ const documentHeight = Math . max (
129+ document . body . scrollHeight ,
130+ document . documentElement . scrollHeight ,
131+ document . body . offsetHeight ,
132+ document . documentElement . offsetHeight ,
133+ document . body . clientHeight ,
134+ document . documentElement . clientHeight
135+ ) ;
136+
137+ resizer . style . minHeight = documentHeight + 'px' ;
138+ }
139+
140+ /////////////////////////////////////////////////////////////////////////////
141+ //===========================================================================
142+ function setPageInformationHeight ( ) {
143+ const information = document . getElementById ( "page-information" ) ;
144+ if ( ! information ) {
145+ return ;
146+ }
147+
148+ const documentHeight = Math . max (
149+ document . body . scrollHeight ,
150+ document . documentElement . scrollHeight ,
151+ document . body . offsetHeight ,
152+ document . documentElement . offsetHeight ,
153+ document . body . clientHeight ,
154+ document . documentElement . clientHeight
155+ ) ;
156+
157+ information . style . minHeight = documentHeight + 'px' ;
158+ }
159+
160+ /////////////////////////////////////////////////////////////////////////////
161+ //===========================================================================
72162 var _Menu = new Menu ( ) ;
73163
74164 function registerMenuDataItem ( ) {
@@ -90,6 +180,8 @@ <h1>제목</h1>
90180 _Menu . render ( "mainMenu" ) ;
91181 }
92182
183+ /////////////////////////////////////////////////////////////////////////////
184+ //===========================================================================
93185 initializePageResizer ( ) ;
94186
95187 window . addEventListener ( 'resize' ,
0 commit comments