0
0
mirror of https://github.com/Doodle3D/doodle3d-connect.git synced 2024-12-26 02:23:48 +01:00

main forwards to #print when uuid is supplied

This commit is contained in:
Rick Companje 2017-07-11 12:30:08 +02:00
parent f06b8994f0
commit 61a087927f

View File

@ -131,6 +131,8 @@ d3d.util = {
d3d.pageParams.uuid = d3d.util.getQueryParam("uuid"); d3d.pageParams.uuid = d3d.util.getQueryParam("uuid");
$.mobile.document.on( "pagebeforechange", function( event, data ) { $.mobile.document.on( "pagebeforechange", function( event, data ) {
console.log("main.pagebeforechange");
if (typeof data.toPage !== "string") { return; } if (typeof data.toPage !== "string") { return; }
var url = d3d.util.parseURL(data.toPage); var url = d3d.util.parseURL(data.toPage);
if(url.parameters === undefined) { return; } if(url.parameters === undefined) { return; }
@ -143,4 +145,13 @@ d3d.util = {
// make sure that the parameters are not removed from the visible url // make sure that the parameters are not removed from the visible url
event.preventDefault(); event.preventDefault();
}); });
if (d3d.pageParams.uuid) { //connect was opened with printlink
var localip = localStorage.getItem("localip");
var url = "?uuid="+d3d.pageParams.uuid+"#print";
if (localip) {
url += "?localip=" + localip;
}
location.href = url;
}
})(window); })(window);