cdotyone / mochaui

development tree for MochaUI
http://mochaui.org/demo/
Other
290 stars 83 forks source link

MUI.closePanel() aborts with an error, when there is only 1 panel in column - #86 #26

Closed mui-org closed 14 years ago

mui-org commented 14 years ago

Reported by chegabyte, Nov 24, 2009

What steps will reproduce the problem?

  1. new MUI.Panel({...});
  2. MUI.closePanel( $("mainPanel") );

What is the expected output? What do you see instead? panel does close, but firefox reports: Error: $(column).getChildren(".panelWrapper").getLast() is null Source File: http://chegspc/centralcontracts/htdocs/lib/mocha(modified).js Line: 5665

What version of MochaUI are you using? r529 0.9.6 development

On what operating system and with what browser? firefox 3.5.5 / windows 7

Please provide any additional information below.

I fixed my copy by adding an if... on layout.js line 1503

if( panels = $(column).getChildren('.panelWrapper') ) panels.getLast().getElement('.panel').addClass('bottomPanel');

Comment 2 by dennisva...@kpnplanet.nl, Feb 11, 2010

I preferr a more clear solution without changing the line 1503:

original line: $(column).getChildren('.panelWrapper').getLast().getElement('.panel').addClass('bottomPanel');

just add this "if-line" above the original: if( $(column).getChildren('.panelWrapper').getLast() )

mui-org commented 14 years ago

appears to be resolved, working fine in current version. never reaches the line when click close now. If you think it is still a problem, please resubmit with a broken example project.