mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-22 19:55:56 +02:00
trying to destroy web window
This commit is contained in:
parent
0bd6d22611
commit
25d5904d2d
2 changed files with 11 additions and 10 deletions
|
@ -1884,7 +1884,6 @@ var showMenuItem = propertyMenu.addMenuItem("Show in Marketplace");
|
|||
|
||||
propertiesTool = PropertiesTool();
|
||||
var particleExplorerTool = ParticleExplorerTool();
|
||||
particleExplorerTool.createWebView();
|
||||
entityListTool.webView.eventBridge.webEventReceived.connect(function(data) {
|
||||
var data = JSON.parse(data);
|
||||
if (data.type == "selectionUpdate") {
|
||||
|
@ -1892,19 +1891,19 @@ entityListTool.webView.eventBridge.webEventReceived.connect(function(data) {
|
|||
if(ids.length === 1) {
|
||||
if (Entities.getEntityProperties(ids[0], "type").type === "ParticleEffect") {
|
||||
// Now we want to activate the partice explorer panel!
|
||||
particleExplorerTool.createWebView();
|
||||
print("EBL ACTIVATE PARTICLE EXPLORER");
|
||||
particleExplorerTool.setVisible(true);
|
||||
var properties = Entities.getEntityProperties(ids[0]);
|
||||
var data = {
|
||||
messageType: "particle_settings",
|
||||
currentProperties: properties
|
||||
};
|
||||
|
||||
particleExplorerTool.setActiveParticleEntity(ids[0]);
|
||||
particleExplorerTool.webView.eventBridge.emitScriptEvent(JSON.stringify(data));
|
||||
|
||||
} else {
|
||||
particleExplorerTool.setVisible(false);
|
||||
print("EBL CLOSE WEB VIEW")
|
||||
particleExplorerTool.destroyWebView();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,11 +11,17 @@ ParticleExplorerTool = function() {
|
|||
toolWindow: true
|
||||
});
|
||||
|
||||
var visible = false;
|
||||
that.webView.setVisible(visible);
|
||||
that.webView.setVisible(true);
|
||||
that.webView.eventBridge.webEventReceived.connect(that.webEventReceived);
|
||||
}
|
||||
|
||||
|
||||
that.destroyWebView = function() {
|
||||
print("EBL DESTROY WEB VIEW" + that.webView);
|
||||
that.webView.close();
|
||||
that.webView = null;
|
||||
}
|
||||
|
||||
that.webEventReceived = function(data) {
|
||||
var data = JSON.parse(data);
|
||||
if (data.messageType === "settings_update") {
|
||||
|
@ -28,10 +34,6 @@ ParticleExplorerTool = function() {
|
|||
that.activeParticleEntity = id;
|
||||
}
|
||||
|
||||
that.setVisible = function(newVisible) {
|
||||
visible = newVisible;
|
||||
that.webView.setVisible(visible);
|
||||
}
|
||||
|
||||
return that;
|
||||
|
||||
|
|
Loading…
Reference in a new issue