From ef42327cc52f0dabefe271fd664bdda49d28bc93 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Fri, 28 Feb 2020 16:36:09 +0300 Subject: [PATCH] Fix gdml demo file loader --- .../dataforge/vis/spatial/gdml/demo/GDMLDemoApp.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/demo/gdml/src/jsMain/kotlin/hep/dataforge/vis/spatial/gdml/demo/GDMLDemoApp.kt b/demo/gdml/src/jsMain/kotlin/hep/dataforge/vis/spatial/gdml/demo/GDMLDemoApp.kt index 92ab0f6f..b9537275 100644 --- a/demo/gdml/src/jsMain/kotlin/hep/dataforge/vis/spatial/gdml/demo/GDMLDemoApp.kt +++ b/demo/gdml/src/jsMain/kotlin/hep/dataforge/vis/spatial/gdml/demo/GDMLDemoApp.kt @@ -135,12 +135,13 @@ private class GDMLDemoApp : Application { val action: (name: String, data: String) -> Unit = { name, data -> canvasElement.clear() spinner(true) - message("Loading GDML") - val gdml = GDML.format.parse(GDML.serializer(), data) - message("Converting GDML into DF-VIS format") - val visual: VisualObject3D = when { - name.endsWith(".gdml") || name.endsWith(".xml") -> gdml.toVisual(gdmlConfiguration) + name.endsWith(".gdml") || name.endsWith(".xml") -> { + message("Loading GDML") + val gdml = GDML.format.parse(GDML.serializer(), data) + message("Converting GDML into DF-VIS format") + gdml.toVisual(gdmlConfiguration) + } name.endsWith(".json") -> VisualGroup3D.fromJson(data) else -> { window.alert("File extension is not recognized: $name")