From: Marcin Haba Date: Mon, 27 Nov 2017 20:10:09 +0000 (+0100) Subject: baculum: Enlarge interface height to 100% X-Git-Tag: Release-9.0.7~23 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=32da794e57c06cec15c8f74ed113234f591feee5;p=bacula%2Fbacula baculum: Enlarge interface height to 100% --- diff --git a/gui/baculum/protected/Web/JavaScript/configuration-window.js b/gui/baculum/protected/Web/JavaScript/configuration-window.js index a7c73fdfbe..7a393adcf1 100644 --- a/gui/baculum/protected/Web/JavaScript/configuration-window.js +++ b/gui/baculum/protected/Web/JavaScript/configuration-window.js @@ -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(); +}); diff --git a/gui/baculum/protected/Web/JavaScript/misc.js b/gui/baculum/protected/Web/JavaScript/misc.js index 1327080579..73f43185b6 100644 --- a/gui/baculum/protected/Web/JavaScript/misc.js +++ b/gui/baculum/protected/Web/JavaScript/misc.js @@ -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); } } diff --git a/gui/baculum/protected/Web/JavaScript/panel-window.js b/gui/baculum/protected/Web/JavaScript/panel-window.js index c2b1d1d862..baeb923dab 100644 --- a/gui/baculum/protected/Web/JavaScript/panel-window.js +++ b/gui/baculum/protected/Web/JavaScript/panel-window.js @@ -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(); }); diff --git a/gui/baculum/protected/Web/JavaScript/slide-window.js b/gui/baculum/protected/Web/JavaScript/slide-window.js index 442fcf5050..9232a60a15 100644 --- a/gui/baculum/protected/Web/JavaScript/slide-window.js +++ b/gui/baculum/protected/Web/JavaScript/slide-window.js @@ -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(); -});