From 071396bed001eaa9369de40c7603b4f802476edc Mon Sep 17 00:00:00 2001 From: Liv Date: Mon, 9 Apr 2018 18:34:53 -0700 Subject: [PATCH] move logic for disconnecting out of initalize() and into setActive() --- scripts/system/edit.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index bfea26d869..c3854ca80b 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -452,16 +452,15 @@ var toolBar = (function () { } } + function clearWindow() { + tablet.gotoHomeScreen(); + }; + function initialize() { Script.scriptEnding.connect(cleanup); Window.domainChanged.connect(function () { that.setActive(false); that.clearEntityList(); - tablet.gotoHomeScreen(); - }); - - Window.domainConnectionRefused.connect(function () { - tablet.gotoHomeScreen(); }); Entities.canAdjustLocksChanged.connect(function (canAdjustLocks) { @@ -723,6 +722,8 @@ var toolBar = (function () { cameraManager.disable(); selectionDisplay.triggerMapping.disable(); tablet.landscape = false; + Window.domainChanged.disconnect(clearWindow); + Window.domainConnectionRefused.disconnect(clearWindow); } else { tablet.loadQMLSource("hifi/tablet/Edit.qml", true); UserActivityLogger.enabledEdit(); @@ -734,6 +735,8 @@ var toolBar = (function () { print("starting tablet in landscape mode"); tablet.landscape = true; entityIconOverlayManager.setIconsSelectable(null,false); + Window.domainChanged.connect(clearWindow); + Window.domainConnectionRefused.connect(clearWindow); // Not sure what the following was meant to accomplish, but it currently causes // everybody else to think that Interface has lost focus overall. fogbugzid:558 // Window.setFocus();