From 55ba530dc469bebcb074f95d568812758d399c2d Mon Sep 17 00:00:00 2001 From: kovacsv Date: Sun, 7 Nov 2021 11:31:31 +0100 Subject: [PATCH] Switch files panel icon when there are missing files. --- website/o3dv/js/navigator.js | 5 +++++ website/o3dv/js/panelset.js | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/website/o3dv/js/navigator.js b/website/o3dv/js/navigator.js index 0422fad..0238895 100644 --- a/website/o3dv/js/navigator.js +++ b/website/o3dv/js/navigator.js @@ -148,6 +148,11 @@ OV.Navigator = class FillTree (importResult) { this.filesPanel.Fill (importResult); + if (importResult.missingFiles.length === 0) { + this.panelSet.SetPanelIcon (this.filesPanel, 'files'); + } else { + this.panelSet.SetPanelIcon (this.filesPanel, 'missing_files'); + } this.materialsPanel.Fill (importResult); this.meshesPanel.Fill (importResult); this.OnSelectionChanged (); diff --git a/website/o3dv/js/panelset.js b/website/o3dv/js/panelset.js index 1a3c560..88deb3d 100644 --- a/website/o3dv/js/panelset.js +++ b/website/o3dv/js/panelset.js @@ -55,6 +55,7 @@ OV.PanelSet = class this.menuDiv = $('
').addClass ('ov_panel_set_menu').appendTo (parentDiv); this.contentDiv = $('
').addClass ('ov_panel_set_content').appendTo (parentDiv); this.panels = []; + this.panelButtons = []; this.panelsVisible = true; this.panelsPrevWidth = null; this.callbacks = null; @@ -74,6 +75,7 @@ OV.PanelSet = class { this.panels.push (panel); let button = OV.AddSvgIcon (this.menuDiv, panel.GetIcon (), 'ov_panel_set_menu_button'); + this.panelButtons.push (button); button.click (() => { if (panel === this.GetVisiblePanel ()) { this.ShowPanels (false); @@ -133,6 +135,13 @@ OV.PanelSet = class return null; } + SetPanelIcon (panel, icon) + { + const panelIndex = this.panels.indexOf (panel); + let panelButton = this.panelButtons[panelIndex]; + OV.SetSvgIconImage (panelButton, icon); + } + Resize () { let height = this.parentDiv.height ();