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

cleanup BoxPage.js

This commit is contained in:
Rick Companje 2017-06-20 21:42:49 +02:00
parent 9bf4b90b2f
commit e67dc79fb3

View File

@ -12,8 +12,10 @@
var _title;
var _intro;
var _drawItem;
var _printItem;
var _updateItem;
var _settingsItem;
var _controlItem;
var _joinNetworkItem;
var _defaultItems;
@ -38,7 +40,9 @@
_drawItem = _list.find("#drawItem");
_updateItem = _list.find("#updateItem");
_settingsItem = _list.find("#settingsItem");
_controlItem = _list.find("#controlItem");
_joinNetworkItem = _list.find("#joinNetworkItem");
_printItem = _list.find("#printItem");
// make sure draw link is opened in same WebApp (added to homescreen)
// and it doesn't start a browser
@ -64,6 +68,8 @@
setNetworkStatus(NetworkAPI.STATUS.CONNECTED);
retrieveNetworkStatus();
});
$.mobile.document.on( "pagebeforehide", PAGE_ID, function( event, data ) {
clearTimeout(_retryRetrieveStatusDelay);
@ -89,6 +95,7 @@
// display the right buttons
_defaultItems.toggleClass("ui-screen-hidden",false);
_printItem.toggleClass("ui-screen-hidden",false);
_joinNetworkItem.toggleClass("ui-screen-hidden",true);
//update link
@ -124,6 +131,23 @@
_settingsItem.find("a").attr("href",settingsLink);
_settingsItem.toggleClass("ui-screen-hidden",false);
//settingsLink
var controlLink = _controlItem.find("a").attr("href");
controlLink = d3d.util.replaceURLParameters(controlLink,_boxData);
_controlItem.find("a").attr("href",controlLink);
_controlItem.toggleClass("ui-screen-hidden",false);
//printLink
var printLink = _printItem.find("a").attr("href");
printLink = d3d.util.replaceURLParameters(printLink,_boxData);
_printItem.find("a").attr("href",printLink);
if (d3d && d3d.pageParams && d3d.pageParams.uuid) {
_printItem.show();
} else {
_printItem.hide();
}
// ToDo: update footer with network info
_list.listview('refresh'); // jQuery mobile enhance content