Question

I've got tabs setup for my app using the config file as so:

steroids.config.tabBar.tabs = [
   {
     title: "Index"
     icon: "icons/home.png"
     location: "http://localhost/index.html"
   },
   {
     title: "Top 10"
     icon: "icons/top10.png"
     location: "http://localhost/top10.html"
   },
   {
     title: "Buscar"
     icon: "icons/search.png"
     location: "http://localhost/search.html"
   },
   {
     title: "Favoritos"
     icon: "icons/favs.png"
     location: "http://localhost/favs.html"
   },
   {
     title: "Recomendado"
     icon: "icons/search.png"
     location: "http://localhost/search.html"
   },

 ]

This works fine. The problem is on the Favs page I am trying to get it to refresh at each time it's clicked. Right now I cannot find a way to do this. My current code is inside the jQuery Document Ready function so it works and refreshes the favs list when first entered. But in subsequent times to the page it doesn't refresh. How do I get this page to refresh my list each time it's entered?

Was it helpful?

Solution

I have made this work using the visibilitychange event as described here: http://docs.appgyver.com/en/edge/steroids_Steroids%20Native%20UI_events_events.visibilitychange.md.html

The final correct code to get this to work was:

document.addEventListener("visibilitychange", getFavs, false);

Placing this inside the JS file of the tab worked perfectly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top