framework7

Open full view…

Can I detect what page I am going back from?

Jamie Robe
Sun, 22 Mar 2015 04:03:11 GMT

Hi. I realize that I can tell what page I am coming back to, by the following: --- myApp.onPageBack('create', function (page) { fetchPTCount(); // to refresh the pt counter on main page we going back to // just in case we actually added a new pt }) --- In the above , I am coming back to the create inline page. However, what I want to do is detect if I am coming back from the editing inline page, then I want to skip the create page and just go back a second step to home home -->create --> editing home <-- (skip create or pass thru it without stopping) <-editing Is this possible? You see, the create page is not needed again. However, I also navigate to editing page from other inbox page, so editing does not know if it was reached from inbox or create. I guess I could force the editing page to always go back to the inbox????

llaume
Sun, 22 Mar 2015 09:41:57 GMT

Hi, I have exactly the same request ! Is it possible to change with javascript the history ? so that we can delete the first previous page if needed ? (Create page in your example when your are on editing page)

Vladimir Kharlampidi
Sun, 22 Mar 2015 10:17:33 GMT

In pageData (http://www.idangero.us/framework7/docs/pages.html#page-data) there is a `pageFrom` property, but you can always just use `<a href="#homePageName" class="back" data-force="true">Back</a>` on editing page to skip the Create one. Or the same with `router.back({pageName: 'homePageName', force:true})`

Jamie Robe
Mon, 23 Mar 2015 00:51:39 GMT

Thanks - that did it. I didn't need any js code, as I just made the editing always go back to inbox. Just to be complete for others who might need this: --- <!-- Navbar inner for editing page--> <div data-page="editing" class="navbar-inner cached"> <div class="left sliding"> <a href="#inbox" class="back link" data-force="true"> <!--<a href="#" class="back link"> --> <i class="icon icon-back"></i><span>Back</span> </a> </div> <div class="center sliding"id="editing_title" >editing</div> </div> ---

plague69
Thu, 17 Aug 2017 02:52:52 GMT

Just a heads up guys, "fromPage" not "pageFrom" (at least in the latest version). Took a few minutes to realize lol