문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top