mirror of
https://github.com/Doodle3D/doodle3d-connect.git
synced 2024-11-05 07:03:24 +01:00
Redirect to start page when no parameters available
This commit is contained in:
parent
985530b896
commit
ad2c2fcb4e
@ -44,6 +44,10 @@
|
||||
$.mobile.document.on( "pagebeforeshow", PAGE_ID, function( event, data ) {
|
||||
console.log("Box page pagebeforeshow");
|
||||
_boxData = d3d.util.getPageParams(PAGE_ID);
|
||||
if(_boxData === undefined) {
|
||||
$.mobile.changePage("#boxes");
|
||||
return;
|
||||
}
|
||||
var boxURL = "http://"+_boxData.localip;
|
||||
//console.log(" _boxData: ",_boxData);
|
||||
|
||||
|
@ -38,6 +38,10 @@
|
||||
$.mobile.document.on( "pagebeforeshow", PAGE_ID, function( event, data ) {
|
||||
console.log("Connecting to network page pagebeforeshow");
|
||||
_pageData = d3d.util.getPageParams(PAGE_ID);
|
||||
if(_pageData === undefined) {
|
||||
$.mobile.changePage("#boxes");
|
||||
return;
|
||||
}
|
||||
var boxURL = "http://"+_pageData.localip;
|
||||
|
||||
var form = data.prevPage.find("form");
|
||||
|
@ -29,6 +29,10 @@
|
||||
$.mobile.document.on( "pagebeforeshow", PAGE_ID, function( event, data ) {
|
||||
console.log("Join network page pagebeforeshow");
|
||||
_boxData = d3d.util.getPageParams(PAGE_ID);
|
||||
if(_boxData === undefined) {
|
||||
$.mobile.changePage("#boxes");
|
||||
return;
|
||||
}
|
||||
var boxURL = "http://"+_boxData.localip;
|
||||
console.log(" _boxData: ",_boxData);
|
||||
|
||||
|
@ -34,6 +34,10 @@
|
||||
$.mobile.document.on( "pagebeforeshow", PAGE_ID, function( event, data ) {
|
||||
console.log(PAGE_ID+" pagebeforeshow");
|
||||
_pageData = d3d.util.getPageParams(PAGE_ID);
|
||||
if(_pageData === undefined) {
|
||||
$.mobile.changePage("#boxes");
|
||||
return;
|
||||
}
|
||||
console.log(" _pageData: ",_pageData);
|
||||
_title.text("Join "+_pageData.ssid);
|
||||
_form.attr("id","Join "+_pageData.ssid);
|
||||
|
@ -105,11 +105,11 @@ d3d.util = {
|
||||
// To get to url parameters we need the url
|
||||
// only pagecontainer events contain url's
|
||||
// we parse the parameters and store them in a global object
|
||||
d3d.pageParams = {};
|
||||
$.mobile.document.on( "pagebeforechange", function( event, data ) {
|
||||
if (typeof data.toPage !== "string") { return; }
|
||||
var url = d3d.util.parseURL(data.toPage);
|
||||
if(url.parameters === undefined) { return; }
|
||||
if(!d3d.pageParams) { d3d.pageParams = {}; }
|
||||
d3d.pageParams[url.hash] = url.parameters;
|
||||
|
||||
// let jQuery mobile navigate to page (providing only the page id so it understands)
|
||||
|
Loading…
Reference in New Issue
Block a user