When I go back in history by tapping on the back button in the top left corner the app reacts immediately.
When I use the Android back button, which performs a
app.router.back()
the app is sometimes slower and takes sometimes a second and more, even on the same page.
I just found out that the delay seems to become longer, the more the page is scrolled down.
Let’s say I have a list of 30 items. When I push on the back button at the top of the page, it closes much faster than when I am at the bottom of the page
I did some more measurements and the animations seem to be the reason. As soon as I disable them everything is very fast on any page. Are there any ways to speed up the animations?
Edit: No, and there it is back again… so the animation can not be the reason.
To be honest I can’t imagine what is happening because usual back link calls same router.back() method. Maybe the issue on Cordova side and it produces the delay of backbutton event? Try to put in backbutton event handler something different instead of router.back, for example, try to call alert there app.dialog.alert and see will it still have that delay?
Good to know, maybe this is somehow related as there are a lot of manually assigned events on these pages. Is there any F7 way to remove all events on a page?
$$('.page').find("*").off();
is throwing an error:
Uncaught TypeError: Cannot read property 'split' of undefined
at Dom7.off (framework7.min.js:12)
I have a similiar problem. There is no issue when I move forward through pages. But the problem comes up when I move back through some pages. I attached a screenshot about page async event. There is a timetable that shows async event’s start and end times. Please attention rayon page’s load and back load times. When I click the back button, I wait 4 seconds to see the rayon page.
Here is rayon page’s async event codes:
{
name: 'rayon',
path: '/rayon/:mid/',
async: function (routeTo, routeFrom, resolve, reject) {
if (!isConnectToInternet()) return;
var router = this;
var app = router.app;
var marketid = routeTo.params.mid;
var apptoken = user.getAppToken();
var mobiletoken = user.getMobileToken();
app.preloader.show();
console.log("rayon async started at: "+Date());
app.request({
url:'http://www.blabla.com/services_v2/init/'+apptoken+'/'+marketid,
data:{mobiletoken:mobiletoken},
method:'POST',
dataType:'json',
success: function (data, status, xhr){
app.preloader.hide();
console.log("rayon async stoped at: "+Date());
if (data.result=="1"){
initializeScreen(data.resultDataOrderCount);
resolve(
{ componentUrl: './pages/rayon.html' },
{ context: {data: data} }
);
}
else
ToastMessage(data.resultMessage);
},
error: function (xhr, status){
app.preloader.hide();
var error_message=status;
if (statusErrorMap.hasOwnProperty(status)) error_message=statusErrorMap[status];
ToastMessage(error_message);
}
});
}
Here is the related page statistics in network tab. This page includes xhr object that load data via php file. What should I learn from these results? How can I find the thing that causes slowdown?