14
14
let timeID = null ;
15
15
16
16
const CommandLine = Module ( "commandline" , {
17
- requires : [ "config" , "liberator" , "modes" , "services" , "storage" , "template" , "util" ] ,
17
+ requires : [ "config" , "liberator" , "modes" , "services" , "storage" , "template" , "util" , "styles" ] ,
18
18
19
19
init : function ( ) {
20
20
const self = this ;
@@ -26,6 +26,9 @@ const CommandLine = Module("commandline", {
26
26
storage . newArray ( liberator . storeName ( mode , isPrivate ) , { store : ! isPrivate } ) ;
27
27
} , this ) ;
28
28
29
+ liberator . registerObserver ( "fullscreen" , this . updateBottombar ) ;
30
+ liberator . registerObserver ( "modeChange" , this . updateBottombar ) ;
31
+
29
32
// Really inideal.
30
33
let services = modules . services ; // Storage objects are global to all windows, 'modules' isn't.
31
34
storage . newObject ( "sanitize" , function ( ) {
@@ -180,6 +183,9 @@ const CommandLine = Module("commandline", {
180
183
181
184
this . _commandlineDisplayTimeoutID = null ;
182
185
186
+ this . _bottomBarHidden = false ;
187
+ this . _hlContentSepValue ;
188
+
183
189
this . registerCallback ( "submit" , modes . EX , function ( command ) {
184
190
if ( self . _commandlineDisplayTimeoutID ) {
185
191
window . clearTimeout ( self . _commandlineDisplayTimeoutID ) ;
@@ -560,6 +566,38 @@ const CommandLine = Module("commandline", {
560
566
this . _setPrompt ( "" ) ;
561
567
} ,
562
568
569
+ /**
570
+ * Callback function for updating the Bottombar
571
+ */
572
+ updateBottombar : function ( ) {
573
+ hide = window . fullScreen && liberator . mode == 1 ;
574
+ commandline . hideBottombar ( hide ) ;
575
+ } ,
576
+ /**
577
+ * Totally hides the vimperator bar at the bottom of the screen (for fullscreen mode)
578
+ */
579
+ hideBottombar : function ( hide ) {
580
+ if ( hide == this . _bottomBarHidden )
581
+ return ;
582
+ this . _bottomBarHidden = hide ;
583
+ let bb = document . getElementById ( 'liberator-bottombar' ) ;
584
+ if ( ! bb )
585
+ return ;
586
+
587
+ if ( hide ) {
588
+ this . _hlContentSepValue = highlight . get ( 'ContentSeparator' ) . value ;
589
+ bb . style . height = '0px' ;
590
+ bb . style . overflow = 'hidden' ;
591
+ highlight . set ( 'ContentSeparator' , 'display:none' , true , false ) ;
592
+ }
593
+ else {
594
+ bb . style . height = '' ;
595
+ bb . style . overflow = '' ;
596
+ highlight . set ( 'ContentSeparator' , this . _hlContentSepValue , true , false ) ;
597
+ }
598
+ } ,
599
+
600
+
563
601
/**
564
602
* Make the command line visible, hiding the status messages below
565
603
*
0 commit comments