LuxCal Forum

The place for questions, suggestions and news about the LuxCal Event Calendar

User:   Password:   Remember Me?   
LuxCal Forum / General / Support / Change event window size
Posted:  05 Sep 2012 06:11   Last Edited By: Roel B.
Hi Roel

Whenever I add a new event I have to resize the window to access the buttons.  Please can you tell me where the sizing information is located so that I can fix this?

The Middle Marches Benefice
The villages of Bedstone & Bucknell
Posted:  05 Sep 2012 22:40
Hi Graham,
That's not good.
The Event window should resize automatically to the size of its content. This is done by the onload="winFit(700);" on line 49 of the file canvas/headere.php and the onload="winFit(500);" on line 34 of the file canvas/headerh.php (for the Help window). You can find the JavaScript winFit() function in the file common/general.js.
In the next sub-version, which will be released in the coming days, the winFit function and the way it is called from the header files is optimized to avoid timing problems. Maybe this new release will solve your problem.
Posted:  06 Sep 2012 06:11
As always - thanks Roel. :)
The Middle Marches Benefice
The villages of Bedstone & Bucknell
Posted:  07 Feb 2013 21:06
I'm having a somewhat similar problem but i don't know how to tell if there's a problem with any of the javascript. right now any pop up for the site, whether it be the login form, event details from the public side, event entry from my side, it opens the right width but the height is only like 100px. no one can seem to understand to maximize the window so they just keep thinking the calendar is broken because all they see is the words 'event details' and then nothing because the window is shrunk up so small.

please let me know if there's a fix for this, or even if i have to make them all a standard height and have scroll bars, it's better than the user thinking everything is broken sad
Posted:  07 Feb 2013 23:28
it seems to help a little, the window is a bit taller, but it's still not resizing to be the custom height of the content. do we have any other ideas by chance?
Posted:  08 Feb 2013 00:09   Last Edited By: Roel B.
Hi there,
The window should resize to exactly the required height.
What LuxCal version are you using? Since the release of v2.7.3 nobody complained about this.
Could you give me the URL of your calendar (by email if you prefer), so that I can have a look myself?

(The actual resizing is done by the "winFit function in the file common/toolbox.js and this function is called from the files headere.php and headerh.php . This function has not changed since quite some time and should work properly.)
Posted:  08 Feb 2013 15:55
I'm using the latest version. And I would send you to the site but it's internal. I have messed with some styles and it's in as an iFrame, but nothing that affected that function. I actually went and looked at the post the other person linked me to and found the function and where it applies in the headers. everything was as it should be.

the only things i've really customized with the calendar is I put an if statement around the login option if it's viewed publicly from an iframe, and i tweaked a few things in the CSS. so I can't figure out why it's not resizing correctly.
Posted:  08 Feb 2013 17:12   Last Edited By: Roel B.
Have you looked in different browsers?
I made this winFit function and tested it in Firefox, IE, Opera and Chrome.

I assume you have the same problem with the Help window (the ? on the right side of the navigation bar).

Just to isolate as many external factors as possible, I suggest to perform the following test:
- edit the file canvas/headerh.php, which is the header for the Help window and . . .
- add the winFit function directly to this header file, as follows:
replace the JavaScript code on line 32


<script>window.onload = function() {winFit(500);}</script>



function winFitX(maxH) {
  neededH = Math.min(maxH,document.body.offsetHeight + 6);
  currentH = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight;
window.onload = function() {winFitX(500);}
Note that I've changed the function name from winFit to winFitX (capital X - 2x) to avoid confusion with the original winFit function.

If you now open the Help window, it should automatically resize to an internal height of 500 pixels.
If this works ok, then there must be something wrong with your installation, and we will then take it from there.

Let me know the outcome.
Posted:  11 Feb 2013 17:53
I've implemented this and it doesn't seem to help. I have noticed however it seems to be just a Google Chrome issue. IE and Firefox seem to be okay. Still investigating.
Posted:  11 Feb 2013 18:38
here is my current fix:


function winFit(maxH){
    var isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
    if(isChrome) {
        // is chrome
        window.innerHeight = maxH;
    } else {
        // not chrome
        neededH = Math.min(maxH,document.body.offsetHeight + 6);
        currentH = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight;

i found this: w3 explanation about how chrome doesn't support resizeBy. which would obviously cause a problem. if I get a way to get it to be dynamic from chrome, i'll for sure share. also if you find a better fix, please let me know.

Posted:  11 Feb 2013 22:22   Last Edited By: Roel B.
Hhmm . . . Thanks for posting this!
Now I'm really confused.
If I test the winFit function in the calendar using Chrome and Opera, it works fine with the "window.resizeBy" function and if I run the "try-it-yourself" test of the w3schools site the "windows.resizeBy" function does not work in Chrome and Opera. How interesting!
I will certainly do some more testing and will come back here wink
Posted:  12 Feb 2013 15:54
Yeah mine seems to work very intermittently in chrome. Every once in a while I"ll get an event to auto resize. I'll be excited to see if you get a better fix than mine! Because mine is definitely just a crappy bandaid biggrin
Posted:  14 Feb 2013 00:06   Last Edited By: Roel B.
Window sizes, heights, widths are very tricky and often have cross-browser issues.
The following winFit function should work cross-browser and has been tested in Firefox, Chrome, Opera, IE and Safari:


function winFit(maxH) { //fit window height to its content size
  neededIH = Math.min(maxH,document.body.offsetHeight + 6);
  currentIH = window.innerHeight || document.documentElement.clientHeight;
    if (window.resizeBy) {
    } else {
        currentOW = window.outerWidth;
        currentOH = window.outerHeight;

Posted:  01 Mar 2015 23:11
Some versions of the Seamonkey (Mozilla) browser default to blocking javascript window manipulation.  Luxcal's popup windows will be too small.  To change this : Edit -> Preferences -> Advanced -> Scripts and Plugins - under "Allow scripts to," tick "Move or resize existing windows."