Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Panel: refresh method missing #5659

Open
frequent opened this issue Feb 19, 2013 · 7 comments
Open

Panel: refresh method missing #5659

frequent opened this issue Feb 19, 2013 · 7 comments

Comments

@frequent
Copy link
Contributor

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?

@jaspermdegroot
Copy link
Contributor

@frequent

Thanks for reporting the issue.

The missing refresh method can be considered as a bug so let's try to get this in 1.3.1

@frequent
Copy link
Contributor Author

Cool. Thanks!

@jaspermdegroot
Copy link
Contributor

For 1.4 we plan to work on making it possible to have the panel markup outside the page (so you don't need to duplicate a navmenu on each page). This probably also makes it possible to make the panel widget work without wrapping all the page contents, because we can just transition the page.

Beside that "the missing refresh method can be considered as a bug" is questionable from a semver point of view, so I am going to change the milestone to 1.4.

@jaspermdegroot
Copy link
Contributor

Changed the title of this ticket (original: "panels don't recognize dynamic toolbars, because self._fixedToolbar will be empty").

@frequent
Copy link
Contributor Author

@uGoMobi: much better

@godswearhats
Copy link

Can someone please give me a quick overview on how to reproduce this issue? That way I can test it / fix it :-)

@jaspermdegroot
Copy link
Contributor

We made external panels work in 1.4. Unfortunately we couldn't just transition the page and stop wrapping page contents, because it broke the fixed toolbars on some platforms.
A lot of the things that were part of the _create method are now done just before opening a panel so something like a new fixed toolbar on a page shouldn't be a problem anymore. Maybe we still need to move a few things from _create to a new refresh method. That is something we will look into for 1.5.

@apsdehal apsdehal self-assigned this May 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants