]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Enlarge interface height to 100%
authorMarcin Haba <marcin.haba@bacula.pl>
Mon, 27 Nov 2017 20:10:09 +0000 (21:10 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 9 Dec 2017 14:06:05 +0000 (15:06 +0100)
gui/baculum/protected/Web/JavaScript/configuration-window.js
gui/baculum/protected/Web/JavaScript/misc.js
gui/baculum/protected/Web/JavaScript/panel-window.js
gui/baculum/protected/Web/JavaScript/slide-window.js

index a7c73fdfbef81c0407a8eecdb7b232d8a03d0347..7a393adcf1a28e8a41b501f3902ef8aac9331d0b 100644 (file)
@@ -119,3 +119,16 @@ var ConfigurationWindowClass = jQuery.klass({
 });
 
 var ConfigurationWindow = new ConfigurationWindowClass();
+
+function setContentWidth() {
+       var content_width = $('#container').width() - $('#workspace-menu-left').width() - 1;
+       $('#content').css({'width': content_width + 'px'});
+}
+
+$(window).resize(function() {
+       setContentWidth();
+});
+
+$(function() {
+       setContentWidth();
+});
index 1327080579fadc780fecf4a2f30b9ba5db809b0f..73f43185b6c9133187a2b505840507a1e0f3d010 100644 (file)
@@ -94,7 +94,7 @@ var Formatters = {
                        formatter = this.formatter[i].format_func;
                        for (var i = 0; i < elements.length; i++) {
                                txt = elements[i].firstChild;
-                               if (txt.nodeType === 3) {
+                               if (txt && txt.nodeType === 3) {
                                        txt.nodeValue = formatter(txt.nodeValue);
                                }
                        }
index c2b1d1d862bac483a506b06d46d41d660d41868e..baeb923dab4cf7249ebde0ec5fc6fec8f8dde7e9 100644 (file)
@@ -44,10 +44,24 @@ var PanelWindowClass = jQuery.klass({
                                setContentWidth();
                        }.bind(this)
                });
+       },
+
+       setPanelHeight: function() {
+               for (var i = 0; i < this.windowIds.length; i++) {
+                       var y = window.innerHeight - 130;
+                       document.getElementById(this.windowIds[i]).style.height = y.toString() + 'px';
+               }
+               // set slide window content height
+               document.getElementById('content').style.height = (y-17) + 'px';
        }
 });
 
 var PanelWindow;
 $(function() {
        PanelWindow = new PanelWindowClass();
+       PanelWindow.setPanelHeight();
+});
+
+$(window).resize(function() {
+       PanelWindow.setPanelHeight();
 });
index 442fcf505063dfae3503a8bce8bd49aa59ca33f8..9232a60a1540f935ad1cd77e6839561ceebdf2c8 100644 (file)
@@ -17,18 +17,20 @@ var SlideWindowClass = jQuery.klass({
        gridEl: null,
        checked: [],
        objects: {},
-       windowSize: null,
        initElementId: null,
 
        size: {
-               widthNormal : '53%',
-               heightNormal : '325px',
                widthHalf : '53%',
                heightHalf : '586px',
                widthFull : '100%',
                heightFull : '586px',
                menuWidth: '75px'
        },
+       size_modes: {
+               half: {value: 0, width: '53%', height: '100%'},
+               full: {value: 1, width: '100%', height: '100%'}
+       },
+       current_size_mode: null,
 
        elements : {
                content: 'div.slide-window-content',
@@ -185,57 +187,38 @@ var SlideWindowClass = jQuery.klass({
        },
 
        resetSize : function() {
-               if(this.isConfigurationOpen()) {
+               if (!this.isConfigurationOpen()) {
                        if(this.isFullSize()) {
                                this.halfSizeWindow();
                        } else if(this.isHalfSize()) {
-                                       this.normalSizeWindow();
-                       } else if (this.isNormalSize()){
-                               this.halfSizeWindow();
-                       } else {
-                               this.normalSizeWindow();
-                       }
-               } else {
-                       if(this.isFullSize()) {
-                               this.normalSizeWindow();
-                       } else if(this.isHalfSize() || this.isNormalSize()) {
                                this.fullSizeWindow();
                        }
                }
        },
 
-       isNormalSize: function() {
-               return (this.windowSize == this.size.widthNormal && this.window.height()  + 'px' == this.size.heightNormal);
-       },
-
        isHalfSize: function() {
-               return (this.windowSize == this.size.widthHalf && this.window.height()  + 'px' == this.size.heightHalf);
+               return (this.current_size_mode === this.size_modes.half.value);
        },
 
        isFullSize: function() {
-               return (this.windowSize  == this.size.widthFull && this.window.height()  + 'px' == this.size.heightFull);
+               return (this.current_size_mode === this.size_modes.full.value);
        },
 
-       normalSizeWindow: function() {
-                       this.window.animate({width: this.size.widthNormal, height: this.size.heightNormal}, {duration : 400});
-                       this.windowSize = this.size.widthNormal;
-       },
-       
        halfSizeWindow: function() {
-                       this.window.animate({width: this.size.widthHalf, height: this.size.heightHalf}, {duration : 400});
-                       this.windowSize = this.size.widthHalf;
+               this.window.animate({width: this.size_modes.half.width, height: this.size_modes.half.height}, {duration : 500});
+               this.current_size_mode = this.size_modes.half.value;
        },
        
        fullSizeWindow: function() {
-                       this.window.animate({width: this.size.widthFull, height: this.size.heightFull}, {duration : 400});
-                       this.windowSize = this.size.widthFull;
+               this.window.animate({width: this.size_modes.full.width, height: this.size_modes.full.height}, {duration : 500});
+               this.current_size_mode = this.size_modes.full.value;
        },
 
        hideOtherWindows: function() {
                $('.slide-window-container').css({
                        display : 'none',
-                       width : this.size.widthNormal,
-                       height : this.size.heightNormal
+                       width : this.size_modes.half.width,
+                       height : this.size_modes.half.height
                });
        },
 
@@ -631,24 +614,13 @@ var SlideWindow = new SlideWindowClass()
 
 $(function() {
        if(navigator.userAgent.search("MSIE") > -1  || navigator.userAgent.search("Firefox") > -1 || navigator.userAgent.search("Chrome") > -1) {
-               $('input[type=checkbox], input[type=submit], input[type=radio], input[type=image], a').each(function(el) {
-                       $(el).on('focus', function() {
-                               el.blur();
-                       }.bind(el));
-               });
+               var els = $('input[type=checkbox], input[type=submit], input[type=radio], input[type=image], a');
+               if (els) {
+                       els.each(function(el) {
+                               $(el).on('focus', function() {
+                                       el.blur();
+                               }.bind(el));
+                       });
+               }
        }
 });
-
-function setContentWidth() {
-       var content_width = $('#container').width() - $('#workspace-menu-left').width() - 1;
-       $('#content').css({'width': content_width + 'px'});
-}
-
-
-$(window).resize(function() {
-       setContentWidth();
-});
-
-$(function() {
-       setContentWidth();
-});