What is the expected output?
Window should be maximized to cover the entire workspace.
What do you see instead?
Window is resized but the left edge stays at initial position somewhere in
the middle of the screen.
(and since you can't move a maximized window you can't drag it).
What version of MochaUI are you using?
Current SVN version (June 15th)
On what operating system and with what browser?
WinXP. FF3, Safari4, Chrome2
Please provide any additional information below.
Problem is caused by the lines at #2500 in Window.js (resizeWindow)
example:
"var top = options.top || oldTop;"
The intention is that if options.top is undefined/null the default should
be "oldTop".
But, if options.top == 0 the OR operation will still evaluate and return
oldTop.
Solution:
Change to this style instead.
"var top = typeof(options.top) != 'undefined' ? options.top : oldTop;"
(and similar for the other three places this pattern is used around #2500)
I've been bitten by this gotcha couple of times myself. "||" is just so
convenient..
Regards
// Fredrik Blomqvist
Comment 1 by fblomqvist, Sep 22, 2009
.. also noticed that the same kind of error is present when setting the initial
position of the window. Since the code uses "if (!options.x)" 0 will be interpreted
as false. Change to "if (options.x == null)".
Reported by fblomqvist, Jun 15, 2009
What steps will reproduce the problem?
What is the expected output? Window should be maximized to cover the entire workspace.
What do you see instead? Window is resized but the left edge stays at initial position somewhere in the middle of the screen. (and since you can't move a maximized window you can't drag it).
What version of MochaUI are you using? Current SVN version (June 15th)
On what operating system and with what browser? WinXP. FF3, Safari4, Chrome2
Please provide any additional information below. Problem is caused by the lines at #2500 in Window.js (resizeWindow) example: "var top = options.top || oldTop;" The intention is that if options.top is undefined/null the default should be "oldTop". But, if options.top == 0 the OR operation will still evaluate and return oldTop.
Solution: Change to this style instead. "var top = typeof(options.top) != 'undefined' ? options.top : oldTop;" (and similar for the other three places this pattern is used around #2500)
I've been bitten by this gotcha couple of times myself. "||" is just so convenient..
Regards // Fredrik Blomqvist
Comment 1 by fblomqvist, Sep 22, 2009
.. also noticed that the same kind of error is present when setting the initial position of the window. Since the code uses "if (!options.x)" 0 will be interpreted as false. Change to "if (options.x == null)".
// Fredrik