Browse Source

Merge pull request #4594 from RaananW/animation-names

[Viewer] offered the possibility to change animation names
Raanan Weber 7 years ago
parent
commit
2e108d5dcf
2 changed files with 3 additions and 3 deletions
  1. 2 2
      Viewer/assets/templates/default/navbar.html
  2. 1 1
      Viewer/src/viewer/defaultViewer.ts

+ 2 - 2
Viewer/assets/templates/default/navbar.html

@@ -457,10 +457,10 @@
             </button>
             <div class="menu-options">
                 {{#each animations}} {{#unless (eq ../selectedAnimation (add @index 1))}}
-                <button class="flex-container label-option-button animation-buttons" data-value="{{this}}">
+                <button class="flex-container label-option-button animation-buttons" data-value="{{this.value}}">
                     <!-- <div> -->
                     <span class="icon types-icon"></span>
-                    <span class="control-text animation-label">{{this}}</span>
+                    <span class="control-text animation-label">{{this.label}}</span>
                     <span class="control-text animation-number">{{add @index 1}}</span>
                     <!-- </div> -->
                 </button>

+ 1 - 1
Viewer/src/viewer/defaultViewer.ts

@@ -358,7 +358,7 @@ export class DefaultViewer extends AbstractViewer {
         } else {
 
             let animationNames = model.getAnimationNames();
-            newParams.animations = animationNames;
+            newParams.animations = animationNames.map(a => { return { label: a, value: a } });
             if (animationNames.length) {
                 this._isAnimationPaused = (model.configuration.animation && !model.configuration.animation.autoStart) || !model.configuration.animation;
                 this._animationList = animationNames;