From ba41ada99e061fdc554481362ae24b4a2c18dcfa Mon Sep 17 00:00:00 2001 From: Viktor Kovacs Date: Sat, 29 May 2021 09:23:49 +0200 Subject: [PATCH] Feature toggle for quantity calculation. --- website/o3dv/featureset.js | 3 ++- website/o3dv/info.js | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/website/o3dv/featureset.js b/website/o3dv/featureset.js index e06b5ce..aa2364e 100644 --- a/website/o3dv/featureset.js +++ b/website/o3dv/featureset.js @@ -1,4 +1,5 @@ OV.FeatureSet = { - SetDefaultColor : false + SetDefaultColor : false, + CalculateQuantities : false }; diff --git a/website/o3dv/info.js b/website/o3dv/info.js index b170196..2e59dbe 100644 --- a/website/o3dv/info.js +++ b/website/o3dv/info.js @@ -134,10 +134,12 @@ OV.InfoPanel = class } let obj = this; - this.CreateButton (contentDiv, 'Calculate Quantities', function (button) { - obj.popup = OV.ShowQuantitiesPopup (button, info.element); - }); - + if (OV.FeatureSet.CalculateQuantities) { + this.CreateButton (contentDiv, 'Calculate Quantities', function (button) { + obj.popup = OV.ShowQuantitiesPopup (button, info.element); + }); + } + let materialsText = 'Materials (' + materialItems.length + ')'; this.CreateButton (contentDiv, materialsText, function (button) { obj.popup = OV.ShowListPopup (button, materialItems, {