diff --git a/tools/config.json b/tools/config.json index 8979558..700494b 100644 --- a/tools/config.json +++ b/tools/config.json @@ -78,7 +78,7 @@ "website/o3dv/modeldata.js", "website/o3dv/navigator.js", "website/o3dv/sidebarpanel.js", - "website/o3dv/propertysidebarpanel.js", + "website/o3dv/detailssidebarpanel.js", "website/o3dv/sidebar.js", "website/o3dv/hashhandler.js", "website/o3dv/website.css", diff --git a/website/embed.html b/website/embed.html index a297989..dec526f 100644 --- a/website/embed.html +++ b/website/embed.html @@ -92,7 +92,7 @@ - + diff --git a/website/index.html b/website/index.html index 2c71af3..d7f17ba 100644 --- a/website/index.html +++ b/website/index.html @@ -92,7 +92,7 @@ - + diff --git a/website/o3dv/propertysidebarpanel.js b/website/o3dv/detailssidebarpanel.js similarity index 99% rename from website/o3dv/propertysidebarpanel.js rename to website/o3dv/detailssidebarpanel.js index c27cc62..46001fe 100644 --- a/website/o3dv/propertysidebarpanel.js +++ b/website/o3dv/detailssidebarpanel.js @@ -1,4 +1,4 @@ -OV.PropertySidebarPanel = class extends OV.SidebarPanel +OV.DetailsSidebarPanel = class extends OV.SidebarPanel { constructor (parentDiv) { diff --git a/website/o3dv/sidebar.js b/website/o3dv/sidebar.js index fa4a81b..9c28600 100644 --- a/website/o3dv/sidebar.js +++ b/website/o3dv/sidebar.js @@ -1,6 +1,6 @@ OV.SidebarPanelId = { - Properties : 0 + Details : 0 }; OV.Sidebar = class @@ -12,7 +12,7 @@ OV.Sidebar = class this.titleDiv = null; this.contentDiv = null; this.panels = [ - new OV.PropertySidebarPanel (this.parentDiv) + new OV.DetailsSidebarPanel (this.parentDiv) ]; } @@ -28,12 +28,21 @@ OV.Sidebar = class } } - Show (show) + Show (panelId) { - this.visible = show; - if (this.visible) { + if (panelId !== null) { + this.visible = true; this.parentDiv.show (); + for (let i = 0; i < this.panels.length; i++) { + const panel = this.panels[i]; + if (i === panelId) { + panel.Show (true); + } else { + panel.Show (false); + } + } } else { + this.visible = false; this.parentDiv.hide (); } } @@ -43,6 +52,19 @@ OV.Sidebar = class return this.visible; } + GetVisiblePanelId () + { + if (!this.visible) { + return null; + } + for (let i = 0; i < this.panels.length; i++) { + if (this.panels[i].IsVisible ()) { + return i; + } + } + return null; + } + Resize () { for (let i = 0; i < this.panels.length; i++) { diff --git a/website/o3dv/sidebarpanel.js b/website/o3dv/sidebarpanel.js index d3455c8..1a809c7 100644 --- a/website/o3dv/sidebarpanel.js +++ b/website/o3dv/sidebarpanel.js @@ -3,10 +3,10 @@ OV.SidebarPanel = class constructor (parentDiv) { this.parentDiv = parentDiv; - this.panelDiv = $('