Open duanw opened 10 years ago
you get logged out if you hit the home button in the nav, probably have something to do with the res.redirect('back') and jquery mobile's ajax stuff.
Any redirect after a post in jquery mobile will mess up any subsequent requests on the next page. This is because, say I log out, and get redirected to the home page '/.' The page view is '/' but the url address is '/logout' so none of the references on the page, like '#menu' or any js that pulls info from the address can't get the correct string. The only way to get around this without getting rid of jqm is to do something in all the form requests. So pretty much process the server's redirect location on the client side. A real pain since I don't really know how to do it.
I'm not sure how, but maybe: http://stackoverflow.com/questions/6559639/error-with-redirects-in-jquery-mobile or https://forum.jquery.com/topic/how-can-i-do-a-form-post-w-a-location-redirect
Another problem is that any page specific scripts are not loaded unless the url is loaded (aka clicking on a link to an event does not load the page js). So any google maps, calls to AJAX, etc will break jqm.
This is also an option:
<script type="text/javascript"> $(document).bind("mobileinit", function () { $.mobile.ajaxEnabled = false; }); </script>
By disabling AJAX loading it will keep the CSS and styling and all that, but will not load pages before they are clicked. So slower loading times. Also no transition animation between pages. But we can redirect from the server and load js files, so there's that.
Adding new roster spot, currently low usability because it doesn't confirm the creation of a new user. Hopefully it could confirm the existence of a user/confirm creation of a new user instead. Also pull up a list of all the associated players to add if the player exists, otherwise lets the person using the app to add a new player.