PDA

View Full Version : .show()/.hide() on a toolbar doesn't work properly



popoffka
31 May 2011, 8:40 AM
Sencha Touch version tested:

1.1.0

http://dev.sencha.com/deploy/touch/resources/css/sencha-touch.css
http://popoffka.ru/map/style.mobile.css




Platform tested against:

Google Chrome dev 13.0.772.0
BlackBerry TabletOS 1.0.3.1868 running on a BlackBerry PlayBook


Description:

When I use .show() or .hide() on a toolbar, the toolbar doesn't (dis)appear unless the browser is resized or device's orientation is changed.


Test Case:

See this URL : http://popoffka.ru/map/index.html


Steps to reproduce the problem:

Load the page
Press the button in the bottom-left corner

Here's the code that this button executes:

if (panelHidden)
app.viewport.dockedItems.items[0].show();
else
app.viewport.dockedItems.items[0].hide();
panelHidden = !panelHidden;

Press the button once again


The result that was expected:

A toolbar appears in the page's top
A toolbar disappears after the second press


The result that occurs instead:

Nothing seems to be happening after the first press, however, if you resize the browser or change the device's orientation, the toolbar will finally appear
After the first press, if the toolbar was visible, it becomes invisible, however, it doesn't disappear, i.e., the space that was occupied by it becomes white instead of hosting other elements (as if the element was assigned "visibility: hidden" instead of "display: none"). However, after you resize the browser or change the device's orientation, everything becomes OK.


Screenshot or Video:

None, but I'll provide them if they're required


Debugging already done:

None


Possible fix:

Not provided

rdougan
3 Jun 2011, 2:51 PM
Did you fix this? I just tested it on Chrome and it works as expected.

popoffka
3 Jun 2011, 9:43 PM
Yeah, already fixed it. Turns out I had to add this code:

app.viewport.dockedItems.items[0].rendered = false;
app.viewport.doComponentLayout();