|
1 | 1 | import { Color, ColorToHexString } from '../engine/model/color.js';
|
2 | 2 | import { AddDiv, AddDomElement, AddRangeSlider, AddToggle, AddCheckbox, ShowDomElement, SetDomElementOuterHeight } from '../engine/viewer/domutils.js';
|
3 | 3 | import { CalculatePopupPositionToElementTopLeft } from './dialogs.js';
|
| 4 | +import { FeatureSet } from './featureset.js'; |
4 | 5 | import { PopupDialog } from './modal.js';
|
5 | 6 | import { Settings, Theme } from './settings.js';
|
6 | 7 | import { SidebarPanel } from './sidebarpanel.js';
|
@@ -154,17 +155,19 @@ class SettingsModelDisplaySection extends SettingsSection
|
154 | 155 |
|
155 | 156 | Init (settings, callbacks)
|
156 | 157 | {
|
157 |
| - this.environmentMapButton = AddDiv (this.contentDiv, 'ov_panel_button'); |
158 |
| - AddSvgIconElement (this.environmentMapButton, 'arrow_left', 'ov_panel_button_left_icon'); |
159 |
| - AddDiv (this.environmentMapButton, 'ov_panel_button_text', 'Environment Map'); |
160 |
| - this.environmentMapButton.addEventListener ('click', () => { |
161 |
| - this.environmentMapPopup = new EnvironmentMapPopup (); |
162 |
| - this.environmentMapPopup.ShowPopup (this.environmentMapButton, settings, { |
163 |
| - onEnvironmentMapChange : () => { |
164 |
| - callbacks.onEnvironmentMapChange (); |
165 |
| - } |
| 158 | + if (FeatureSet.EnvironmentMap) { |
| 159 | + this.environmentMapButton = AddDiv (this.contentDiv, 'ov_panel_button'); |
| 160 | + AddSvgIconElement (this.environmentMapButton, 'arrow_left', 'ov_panel_button_left_icon'); |
| 161 | + AddDiv (this.environmentMapButton, 'ov_panel_button_text', 'Environment Map'); |
| 162 | + this.environmentMapButton.addEventListener ('click', () => { |
| 163 | + this.environmentMapPopup = new EnvironmentMapPopup (); |
| 164 | + this.environmentMapPopup.ShowPopup (this.environmentMapButton, settings, { |
| 165 | + onEnvironmentMapChange : () => { |
| 166 | + callbacks.onEnvironmentMapChange (); |
| 167 | + } |
| 168 | + }); |
166 | 169 | });
|
167 |
| - }); |
| 170 | + } |
168 | 171 |
|
169 | 172 | let backgroundColorDiv = AddDiv (this.contentDiv, 'ov_sidebar_parameter');
|
170 | 173 | let backgroundColorInput = AddDiv (backgroundColorDiv, 'ov_color_picker');
|
@@ -216,7 +219,9 @@ class SettingsModelDisplaySection extends SettingsSection
|
216 | 219 |
|
217 | 220 | UpdateVisibility (isPhysicallyBased)
|
218 | 221 | {
|
219 |
| - ShowDomElement (this.environmentMapButton, isPhysicallyBased); |
| 222 | + if (this.environmentMapButton !== null) { |
| 223 | + ShowDomElement (this.environmentMapButton, isPhysicallyBased); |
| 224 | + } |
220 | 225 | }
|
221 | 226 |
|
222 | 227 | Update (settings)
|
|
0 commit comments