You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
None of the beforeshow aftershow &c methods get called for a page when the route changes but the page remains displayed.
There maybe a better way of doing this in which case I'd be interested in feedback but I have introduced an onPing option. This will get called for each page in the current route whenever the hash changes. I use it to determine if a page has any sub pages displayed but there would be other use cases.
What I have done is this :
p.showPage = function (route, pageRoute, originalRoute) {
var m = this,
currentId = m.currentId,
params = m.pageRoute ? m.pageRoute.params : null,
isVisible = m.isVisible();
m.currentId = pageRoute ? (pageRoute.name || '') : '';
m.getCurrentId(m.currentId);
m.isVisible(true);
if (originalRoute) {
m.originalRoute(originalRoute);
}
m.route = route;
m.pageRoute = pageRoute;
// show if not already visible
if (!isVisible) {
m.setParams();
m.show();
} else {
// show if wildcard got new ID
if (m.getId() === '?' && currentId !== m.currentId) {
m.show();
}
// update params if they are updated
if (pageRoute && params !== pageRoute.params) {
m.setParams();
}
}
m.childManager.showChild(route);
// new called to ping method for the page
m.ping();
};
and
/** added by gb
called whenever the hash changes and a page is on the current route
**/
p.ping = function () {
var me = this;
if (me.val('onPing'))
{
me.val('onPing')(me);
}
}
Might this not be better as a globally set option where it fires the usual show method, with the option of over-riding it on an element? That's certainly something I've been meaning to add to pager when I get the time.
None of the beforeshow aftershow &c methods get called for a page when the route changes but the page remains displayed.
There maybe a better way of doing this in which case I'd be interested in feedback but I have introduced an onPing option. This will get called for each page in the current route whenever the hash changes. I use it to determine if a page has any sub pages displayed but there would be other use cases.
What I have done is this :
and
In the markup...
The text was updated successfully, but these errors were encountered: