Feature flag for download progress.

This commit is contained in:
kovacsv 2022-07-05 18:08:53 +02:00
parent 5bf4f11d5d
commit 36957d3fbe
4 changed files with 32 additions and 17 deletions

View File

@ -1,4 +1,5 @@
import { AddDiv, CreateDiv } from '../engine/viewer/domutils.js'; import { AddDiv, CreateDiv } from '../engine/viewer/domutils.js';
import { FeatureSet } from './featureset.js';
import { AddSvgIconElement, CreateInlineColorCircle, IsHoverEnabled } from './utils.js'; import { AddSvgIconElement, CreateInlineColorCircle, IsHoverEnabled } from './utils.js';
let currentDialog = null; let currentDialog = null;
@ -144,7 +145,10 @@ export class ProgressDialog extends Dialog
contentDiv.classList.add ('ov_progress'); contentDiv.classList.add ('ov_progress');
let innerContentDiv = AddDiv (contentDiv, 'ov_progress_inner'); let innerContentDiv = AddDiv (contentDiv, 'ov_progress_inner');
AddDiv (innerContentDiv, 'ov_progress_img', '<svg><use href="assets/images/3dviewer_net_logo.svg#logo"></use></svg>'); let imgDiv = AddDiv (innerContentDiv, 'ov_progress_img', '<svg><use href="assets/images/3dviewer_net_logo.svg#logo"></use></svg>');
if (!FeatureSet.DownloadProgress) {
imgDiv.classList.add ('animated');
}
this.textDiv = AddDiv (innerContentDiv, 'ov_progress_text'); this.textDiv = AddDiv (innerContentDiv, 'ov_progress_text');
this.SetText (text); this.SetText (text);

View File

@ -1,4 +1,4 @@
export const FeatureSet = export const FeatureSet =
{ {
DownloadProgress : true
}; };

View File

@ -4,6 +4,7 @@ import { ShowMessageDialog } from './dialogs.js';
import { ButtonDialog, ProgressDialog } from './dialog.js'; import { ButtonDialog, ProgressDialog } from './dialog.js';
import { AddSvgIconElement } from './utils.js'; import { AddSvgIconElement } from './utils.js';
import { ImportErrorCode } from '../engine/import/importer.js'; import { ImportErrorCode } from '../engine/import/importer.js';
import { FeatureSet } from './featureset.js';
export class ThreeModelLoaderUI export class ThreeModelLoaderUI
{ {
@ -30,13 +31,19 @@ export class ThreeModelLoaderUI
}, },
onFileListProgress : (current, total) => { onFileListProgress : (current, total) => {
progressDialog.SetProgress (null); progressDialog.SetProgress (null);
progressDialog.SetText ('Loading File ' + (current + 1).toString () + '/' + total.toString ()); if (FeatureSet.DownloadProgress) {
if (total > 1) {
progressDialog.SetText ('Loading File ' + (current + 1).toString () + '/' + total.toString ());
}
}
}, },
onFileLoadProgress : (current, total) => { onFileLoadProgress : (current, total) => {
if (total > 0) { if (FeatureSet.DownloadProgress) {
progressDialog.SetProgress (current / total); if (total > 0) {
} else { progressDialog.SetProgress (current / total);
progressDialog.SetProgress (null); } else {
progressDialog.SetProgress (null);
}
} }
}, },
onSelectMainFile : (fileNames, selectFile) => { onSelectMainFile : (fileNames, selectFile) => {

View File

@ -230,16 +230,6 @@ div.ov_progress_inner
padding: 20px; padding: 20px;
} }
div.ov_progress div.ov_progress_img svg
{
width: 80px;
height: 80px;
margin-top: 5px;
margin-bottom: 15px;
display: inline-block;
animation: ov_progress_img_kf 5.0s linear infinite;
}
@keyframes ov_progress_img_kf { @keyframes ov_progress_img_kf {
0% { 0% {
transform: rotate(0deg); transform: rotate(0deg);
@ -249,6 +239,20 @@ div.ov_progress div.ov_progress_img svg
} }
} }
div.ov_progress div.ov_progress_img svg
{
width: 80px;
height: 80px;
margin-top: 5px;
margin-bottom: 15px;
display: inline-block;
}
div.ov_progress div.ov_progress_img.animated svg
{
animation: ov_progress_img_kf 5.0s linear infinite;
}
div.ov_progress div.ov_progress_text div.ov_progress div.ov_progress_text
{ {
font-size: 19px; font-size: 19px;