From 61a087927f6fecb43b76c0a95d790cf1e5a91d20 Mon Sep 17 00:00:00 2001 From: Rick Companje Date: Tue, 11 Jul 2017 12:30:08 +0200 Subject: [PATCH] main forwards to #print when uuid is supplied --- js/main.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/main.js b/js/main.js index f60daef..82094a8 100644 --- a/js/main.js +++ b/js/main.js @@ -131,6 +131,8 @@ d3d.util = { d3d.pageParams.uuid = d3d.util.getQueryParam("uuid"); $.mobile.document.on( "pagebeforechange", function( event, data ) { + console.log("main.pagebeforechange"); + if (typeof data.toPage !== "string") { return; } var url = d3d.util.parseURL(data.toPage); if(url.parameters === undefined) { return; } @@ -143,4 +145,13 @@ d3d.util = { // make sure that the parameters are not removed from the visible url 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); \ No newline at end of file