From 6a91a61211c1d914e478328a053ede9331234c13 Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Sun, 8 Feb 2015 14:50:46 +0100 Subject: [PATCH] baculum: Adjust main window size to full browser width --- .../protected/JavaScript/slide-window.js | 35 ++++++-- gui/baculum/protected/Pages/Home.page | 4 +- gui/baculum/protected/Portlets/Console.tpl | 2 +- gui/baculum/themes/Baculum-v1/bls_bottom.png | Bin 3211 -> 2770 bytes gui/baculum/themes/Baculum-v1/bls_top.png | Bin 3591 -> 2815 bytes gui/baculum/themes/Baculum-v1/style.css | 75 +++++++++++------- 6 files changed, 75 insertions(+), 41 deletions(-) diff --git a/gui/baculum/protected/JavaScript/slide-window.js b/gui/baculum/protected/JavaScript/slide-window.js index dd5061653d..0e6e45998d 100644 --- a/gui/baculum/protected/JavaScript/slide-window.js +++ b/gui/baculum/protected/JavaScript/slide-window.js @@ -15,14 +15,16 @@ var SlideWindowClass = Class.create({ gridEl: null, checked: [], objects: {}, + windowSize: null, size: { - widthNormal : '437px', + widthNormal : '53%', heightNormal : '325px', - widthHalf : '437px', + widthHalf : '53%', heightHalf : '586px', - widthFull : '899px', - heightFull : '586px' + widthFull : '100%', + heightFull : '586px', + menuWidth: '75px' }, elements : { @@ -47,7 +49,7 @@ var SlideWindowClass = Class.create({ this.window = $(this.windowId + this.elements.containerSuffix); this.tools = $(this.windowId + this.elements.toolsButtonSuffix); this.options = $(this.windowId + this.elements.optionsButtonSuffix); - + if(data.hasOwnProperty('showId')) { this.showEl = $(data.showId); } else { @@ -158,27 +160,30 @@ var SlideWindowClass = Class.create({ }, isNormalSize: function() { - return (this.window.getWidth() + 'px' == this.size.widthNormal && this.window.getHeight() + 'px' == this.size.heightNormal); + return (this.windowSize == this.size.widthNormal && this.window.getHeight() + 'px' == this.size.heightNormal); }, isHalfSize: function() { - return (this.window.getWidth() + 'px' == this.size.widthHalf && this.window.getHeight() + 'px' == this.size.heightHalf); + return (this.windowSize == this.size.widthHalf && this.window.getHeight() + 'px' == this.size.heightHalf); }, isFullSize: function() { - return (this.window.getWidth() + 'px' == this.size.widthFull && this.window.getHeight() + 'px' == this.size.heightFull); + return (this.windowSize == this.size.widthFull && this.window.getHeight() + 'px' == this.size.heightFull); }, normalSizeWindow: function() { new Effect.Morph(this.window, {style : 'width: ' + this.size.widthNormal + '; height: ' + this.size.heightNormal + ';', duration : 0.4}); + this.windowSize = this.size.widthNormal; }, halfSizeWindow: function() { new Effect.Morph(this.window, {style : 'width: ' + this.size.widthHalf + '; height: ' + this.size.heightHalf + ';', duration : 0.4}); + this.windowSize = this.size.widthHalf; }, fullSizeWindow: function() { new Effect.Morph(this.window, {style : 'width: ' + this.size.widthFull + '; height: ' + this.size.heightFull + ';', duration : 0.4}); + this.windowSize = this.size.widthFull; }, hideOtherWindows: function() { @@ -437,3 +442,17 @@ document.observe("dom:loaded", function() { }); } }); + +function setContentWidth() { + var content_width = $('container').getWidth() - $('menu-left').getWidth() - 1; + $('content').setStyle({'width': content_width + 'px'}); +} + + +Event.observe(window, 'resize', function() { + setContentWidth(); +}); + +document.observe("dom:loaded", function() { + setContentWidth(); +}); diff --git a/gui/baculum/protected/Pages/Home.page b/gui/baculum/protected/Pages/Home.page index feeb2042e7..be63e8ad88 100644 --- a/gui/baculum/protected/Pages/Home.page +++ b/gui/baculum/protected/Pages/Home.page @@ -62,9 +62,9 @@ <%[ Date To: ]%> <%[ Client: ]%> - + <%[ Job name: ]%> - +

<%[ Legend: ]%>

diff --git a/gui/baculum/protected/Portlets/Console.tpl b/gui/baculum/protected/Portlets/Console.tpl index fc0af6a602..eaccc28bb3 100644 --- a/gui/baculum/protected/Portlets/Console.tpl +++ b/gui/baculum/protected/Portlets/Console.tpl @@ -10,7 +10,7 @@