Panel: refresh method missing #5659
Description
I'm playing around with the panel widget and dynamically created content.
When I generate header and footer dynamically, the panel does not "recognize" them = the panel will always open underneath either fixed/non-fixed header and footer.
I traced it to self._fixedToolbar
in the panel widget
being empty. Probably because the toolbars are inserted after the panel widget is setup.
As there is no refresh or panel update method, I can't update the parameters when the dynamic content is inserted.
I hack-fixed it like this inside the panel widget _open
method:
if ( self._page.jqmData('panel') === "open" ) {
self._page.on( "panelclose", function() {
_openPanel();
});
} else {
// re-assign here
self._fixedToolbar = self.element.closest('div:jqmData(role="page")')
.find(".ui-header:jqmData(position='fixed'), .ui-footer:jqmData(position='fixed')" ).addClass( self.options.classes.contentFixedToolbar );
_openPanel();
}
Which still misses the fix for Android plus it's not something I would want to run every time I'm opening the panel.
Is there any other means of updating the panel-config after injecting dynamic content?