File tree Expand file tree Collapse file tree 1 file changed +16
-15
lines changed
Expand file tree Collapse file tree 1 file changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -566,31 +566,32 @@ addButton.addEventListener('click', () => {
566566 [ 0 , 0 ] , [ 0 , 0 ] , true ) ;
567567
568568
569- // if on desktop, open file
569+ // open file
570570
571- if ( ! isMobile ) {
571+ // show file content in codeit
572+ cd . textContent = '\r\n' ;
572573
573- // show file content in codeit
574- cd . textContent = '\r\n' ;
574+ // change codeit lang
575+ cd . lang = getFileLang ( fileName ) ;
575576
576- // change codeit lang
577- cd . lang = getFileLang ( fileName ) ;
577+ // clear codeit history
578+ cd . history = [ ] ;
578579
580+ // update line numbers
581+ updateLineNumbersHTML ( ) ;
582+
583+ // if on desktop
584+ if ( ! isMobile ) {
585+
579586 // set caret pos in codeit
580587 cd . setSelection ( 0 , 0 ) ;
581-
582- // clear codeit history
583- cd . history = [ ] ;
584-
585- // update line numbers
586- updateLineNumbersHTML ( ) ;
587-
588+
588589 // check codeit scrollbar
589590 checkScrollbarArrow ( ) ;
590-
591+
591592 }
592593
593-
594+
594595 // create commit
595596 const commitMessage = 'Create ' + fileName ;
596597
You can’t perform that action at this time.
0 commit comments