@@ -237,10 +237,20 @@ var CodeOceanEditor = {
237237 } ,
238238
239239 resizeSidebars : function ( ) {
240- $ ( '#content-left-sidebar' ) . height ( this . calculateEditorHeight ( '#content-left-sidebar' , false ) ) ;
240+ let editorHeightLeftSidebar = this . calculateEditorHeight ( '#content-left-sidebar' , false ) ;
241+ $ ( '#content-left-sidebar' ) . height ( function ( ) {
242+ if ( $ ( '#resizerHorizontal' ) . css ( 'display' ) === 'none' )
243+ return 'auto' ;
244+ else
245+ return editorHeightLeftSidebar ;
246+ } ) ;
241247 $ ( '#content-right-sidebar' ) . height ( this . calculateEditorHeight ( '#content-right-sidebar' , false ) ) ;
242248 } ,
243249
250+ resizeHorizontalResizer : function ( ) {
251+ $ ( '#resizerHorizontal' ) . height ( this . calculateEditorHeight ( '#resizerHorizontal' , false ) ) ;
252+ } ,
253+
244254 calculateEditorHeight : function ( element , considerStatusbar ) {
245255 const jqueryElement = $ ( element ) ;
246256 if ( jqueryElement . length === 0 ) {
@@ -457,11 +467,18 @@ var CodeOceanEditor = {
457467 handleSideBarToggle : function ( ) {
458468 const sidebar = $ ( '#sidebar' ) ;
459469 sidebar . toggleClass ( 'sidebar-col' ) . toggleClass ( 'sidebar-col-collapsed' ) ;
460- if ( sidebar . hasClass ( 'w-25' ) || sidebar . hasClass ( 'restore-to-w-25' ) ) {
461- sidebar . toggleClass ( 'w-25' ) . toggleClass ( 'restore-to-w-25' ) ;
462- }
463470 $ ( '#sidebar-collapsed' ) . toggleClass ( 'd-none' ) ;
464471 $ ( '#sidebar-uncollapsed' ) . toggleClass ( 'd-none' ) ;
472+ if ( $ ( '#sidebar-uncollapsed' ) . hasClass ( 'd-none' ) ) {
473+ if ( $ ( window ) . width ( ) >= 992 ) {
474+ $ ( '#panel-left' ) . css ( 'width' , $ ( '#sidebar-collapsed' ) . outerWidth ( true ) ) ;
475+ }
476+ $ ( '#panel-left' ) . css ( 'padding-bottom' , '4px' ) ;
477+ } else {
478+ $ ( '#panel-left' ) . css ( 'width' , '' ) ;
479+ $ ( '#panel-left' ) . css ( 'padding-bottom' , '' ) ;
480+ }
481+ $ ( '#resizerHorizontal' ) . toggleClass ( 'd-lg-block' ) ;
465482 } ,
466483
467484 initializeRegexes : function ( ) {
@@ -541,6 +558,15 @@ var CodeOceanEditor = {
541558 } ,
542559
543560 populateCard : function ( card , result , index ) {
561+ if ( result . stderr && ! result . score || result . score < 1 ) {
562+ card . find ( '.card-body' ) . toggleClass ( 'd-none' ) ;
563+ card . find ( 'i' ) . toggleClass ( 'fa-chevron-down fa-chevron-right' )
564+ }
565+ card . find ( '.card-header' ) . on ( 'click' , ( ) => {
566+ card . find ( '.card-body' ) . toggleClass ( 'd-none' ) ;
567+ card . find ( 'i' ) . toggleClass ( 'fa-chevron-down fa-chevron-right' )
568+ } ) ;
569+ card . addClass ( this . getCardClass ( result ) ) ;
544570 card . addClass ( `card border-${ this . getCardClass ( result ) } ` ) ;
545571 card . find ( '.card-header' ) . addClass ( `bg-${ this . getCardClass ( result ) } text-white` ) ;
546572 card . find ( '.card-title .filename' ) . text ( result . filename ) ;
@@ -927,12 +953,30 @@ var CodeOceanEditor = {
927953 $ ( '#output_sidebar_collapsed' ) . addClass ( 'd-none' ) ;
928954 $ ( '#output_sidebar_uncollapsed' ) . removeClass ( 'd-none' ) ;
929955 $ ( '#output_sidebar' ) . removeClass ( 'output-col-collapsed' ) . addClass ( 'output-col' ) ;
956+ if ( window . matchMedia ( '(min-width: 992px)' ) . matches ) {
957+ $ ( '.panel-top' ) . css ( 'height' , '50vh' ) ;
958+ $ ( '.panel-bottom' ) . css ( 'height' , this . calculateEditorHeight ( '.panel-bottom' , false ) ) ;
959+ this . resizeSidebars ( ) ;
960+ $ ( '#resizerVertical' ) . removeClass ( 'd-none' ) ;
961+ } else {
962+ $ ( '.panel-bottom' ) . css ( 'height' , '50vh' ) ;
963+ $ ( 'html, body' ) . animate ( { scrollTop : $ ( document ) . height ( ) - $ ( window ) . height ( ) } , 250 ) ;
964+ }
965+ this . resizeAceEditors ( ) ;
930966 } ,
931967
932968 hideOutputBar : function ( ) {
933969 $ ( '#output_sidebar_collapsed' ) . removeClass ( 'd-none' ) ;
934970 $ ( '#output_sidebar_uncollapsed' ) . addClass ( 'd-none' ) ;
935971 $ ( '#output_sidebar' ) . removeClass ( 'output-col' ) . addClass ( 'output-col-collapsed' ) ;
972+ $ ( '#resizerVertical' ) . addClass ( 'd-none' ) ;
973+ $ ( '.panel-bottom' ) . css ( 'height' , $ ( '#output_sidebar_collapsed' ) . height ( ) + 'px' ) ;
974+ if ( window . matchMedia ( '(min-width: 992px)' ) . matches ) {
975+ $ ( '.panel-top' ) . css ( 'height' , ( $ ( '#editor-column' ) . height ( ) - $ ( '.panel-bottom' ) . height ( ) ) + "px" ) ;
976+ } else {
977+ $ ( 'html, body' ) . animate ( { scrollTop : $ ( document ) . height ( ) - $ ( window ) . height ( ) } , 1 ) ;
978+ }
979+ this . resizeAceEditors ( ) ;
936980 } ,
937981
938982 initializeSideBarTooltips : function ( ) {
0 commit comments