From 27984580f7cd615debefa15a5fc4efb70918124f Mon Sep 17 00:00:00 2001 From: kovacsv Date: Thu, 2 Dec 2021 13:43:40 +0100 Subject: [PATCH] Minor modification. --- website/o3dv/js/sidebar.js | 4 ++-- website/o3dv/js/sidebarpanels.js | 3 +-- website/o3dv/js/website.js | 8 +++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/website/o3dv/js/sidebar.js b/website/o3dv/js/sidebar.js index 67d0330..06777b6 100644 --- a/website/o3dv/js/sidebar.js +++ b/website/o3dv/js/sidebar.js @@ -59,9 +59,9 @@ OV.Sidebar = class }); } - Update (model) + UpdateSettings (hasDefaultMaterial) { - this.settingsPanel.Update (model); + this.settingsPanel.UpdateSettings (hasDefaultMaterial); } Resize (height) diff --git a/website/o3dv/js/sidebarpanels.js b/website/o3dv/js/sidebarpanels.js index 5ac396e..fa69d01 100644 --- a/website/o3dv/js/sidebarpanels.js +++ b/website/o3dv/js/sidebarpanels.js @@ -253,9 +253,8 @@ OV.SettingsSidebarPanel = class extends OV.SidebarPanel this.AddResetToDefaultsButton (); } - Update (model) + UpdateSettings (hasDefaultMaterial) { - let hasDefaultMaterial = OV.HasDefaultMaterial (model); if (!hasDefaultMaterial) { OV.ShowDomElement (this.defaultColorInput.warning); } else { diff --git a/website/o3dv/js/website.js b/website/o3dv/js/website.js index 7ba42e8..5baa653 100644 --- a/website/o3dv/js/website.js +++ b/website/o3dv/js/website.js @@ -145,7 +145,7 @@ OV.Website = class this.viewer.SetMainObject (threeObject); this.viewer.SetUpVector (importResult.upVector, false); this.navigator.FillTree (importResult); - this.sidebar.Update (this.model); + this.UpdateSidebar (); this.FitModelToWindow (true); } @@ -289,6 +289,12 @@ OV.Website = class this.viewer.FitSphereToWindow (boundingSphere, true); } + UpdateSidebar () + { + let hasDefaultMaterial = OV.HasDefaultMaterial (this.model); + this.sidebar.UpdateSettings (hasDefaultMaterial); + } + UpdateMeshesVisibility () { this.viewer.SetMeshesVisibility ((meshUserData) => {