@@ -59,6 +59,7 @@ export function showSerial() {
5959
6060// update type is used to indicate which button was clicked
6161function updatePageLayout ( updateType ) {
62+ // If both are visible, show the separator
6263 if ( isEditorVisible ( ) && isSerialVisible ( ) ) {
6364 pageSeparator . classList . add ( 'active' ) ;
6465 } else {
@@ -72,6 +73,7 @@ function updatePageLayout(updateType) {
7273
7374 // Mobile layout, so only show one or the other
7475 if ( mainContent . offsetWidth < 768 ) {
76+ // Prioritize based on the update type
7577 if ( updateType == UPDATE_TYPE_EDITOR && isEditorVisible ( ) ) {
7678 serialPage . classList . remove ( 'active' ) ;
7779 } else if ( updateType == UPDATE_TYPE_SERIAL && isSerialVisible ( ) ) {
@@ -130,8 +132,7 @@ function fixViewportHeight(e) {
130132}
131133
132134// Resize the panes when the separator is moved
133- function resize ( e ) {
134- console . log ( "Resized" ) ;
135+ function resizePanels ( e ) {
135136 const w = mainContent . offsetWidth ;
136137 const gap = pageSeparator . offsetWidth ;
137138 const ratio = e . clientX / w ;
@@ -182,12 +183,12 @@ function loadPanelSettings() {
182183}
183184
184185function stopResize ( e ) {
185- window . removeEventListener ( 'mousemove' , resize , false ) ;
186+ window . removeEventListener ( 'mousemove' , resizePanels , false ) ;
186187 window . removeEventListener ( 'mouseup' , stopResize , false ) ;
187188}
188189
189190pageSeparator . addEventListener ( 'mousedown' , async function ( e ) {
190- window . addEventListener ( 'mousemove' , resize , false ) ;
191+ window . addEventListener ( 'mousemove' , resizePanels , false ) ;
191192 window . addEventListener ( 'mouseup' , stopResize , false ) ;
192193} ) ;
193194
0 commit comments