Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back button does not work with newly inserted page #2

Open
thomasyip opened this issue Oct 26, 2010 · 5 comments
Open

Back button does not work with newly inserted page #2

thomasyip opened this issue Oct 26, 2010 · 5 comments

Comments

@thomasyip
Copy link
Member

If a page is not loaded by jqtouch automatically, (see GET Ajax Load example on demos\main), this fork doesn't not recognize the page when "back" button is hit.

To workaround the problem, manually add the following line when the page is created:

(note: you will need to remove the workaround when the bug is fixed, or it will affects splitscreen usage).

var defaultSection ="full";  // for single screen
var section = $node.attr('section'); 
if (!section) {
  $node.attr('section', defaultSection);
}                
$node.children().find('[section~="' + section + '"]').removeClass('missection');
$node.children().find('[section]:not([section~="' + section + '"])').addClass('missection');                  
@mckoss
Copy link

mckoss commented Feb 28, 2011

Isn't the section variable undefined in some cases?

@thomasyip
Copy link
Member Author

I think I was pondering on null or "full" as the default, and picked "full" randomly.

This bug probably prove that null as default is better for this case.

@l0c0luke
Copy link

Do I fall into this problem ...

First, many of my pages are drawn as you click. Click, create html, append to jqt, goTo.
Second, I have chosen to roll my own backbutton so I could tweak the coloring a bit more. So to avoid conflicts, the back button container I call back2. I then create a live event on the back2 which executes jQT.goBack().

So what I am finding is that if I go one page in, and then go back, no problems. If I go two pages in, then go back, I go to the second page, but the first page also slides in underneath the second, creating a mess.

@thomasyip
Copy link
Member Author

It might be a variety of it.

If you generate html, adding section="full" should fix it.

Also, you can use the ".goback" class for your own theme. With it, you don't need your own go back method.

    <a href="..." section="full" class="goback">

@l0c0luke
Copy link

goback class is what I needed. you da man. count me out of this backbutton ajax issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants