|
@@ -157,9 +157,10 @@ export class DefaultViewer extends AbstractViewer {
|
|
this._togglePlayPause();
|
|
this._togglePlayPause();
|
|
break;
|
|
break;
|
|
case "label-option-button":
|
|
case "label-option-button":
|
|
- var label = element.dataset["value"];
|
|
|
|
- if (label) {
|
|
|
|
- this._updateAnimationType(label);
|
|
|
|
|
|
+ var value = element.dataset["value"];
|
|
|
|
+ var label = element.querySelector("span.animation-label");
|
|
|
|
+ if (label && value) {
|
|
|
|
+ this._updateAnimationType({ value, label: label.innerHTML });
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case "speed-option-button":
|
|
case "speed-option-button":
|
|
@@ -268,21 +269,21 @@ export class DefaultViewer extends AbstractViewer {
|
|
/**
|
|
/**
|
|
* Update Current Animation Type
|
|
* Update Current Animation Type
|
|
*/
|
|
*/
|
|
- private _updateAnimationType = (label: string, paramsObject?: any) => {
|
|
|
|
|
|
+ private _updateAnimationType = (data: { label: string, value: string }, paramsObject?: any) => {
|
|
let navbar = this.templateManager.getTemplate('navBar');
|
|
let navbar = this.templateManager.getTemplate('navBar');
|
|
if (!navbar) return;
|
|
if (!navbar) return;
|
|
|
|
|
|
- if (label) {
|
|
|
|
- this._currentAnimation = this.sceneManager.models[0].setCurrentAnimationByName(label);
|
|
|
|
|
|
+ if (data) {
|
|
|
|
+ this._currentAnimation = this.sceneManager.models[0].setCurrentAnimationByName(data.value);
|
|
}
|
|
}
|
|
|
|
|
|
if (paramsObject) {
|
|
if (paramsObject) {
|
|
- paramsObject.selectedAnimation = (this._animationList.indexOf(label) + 1);
|
|
|
|
- paramsObject.selectedAnimationName = label;
|
|
|
|
|
|
+ paramsObject.selectedAnimation = (this._animationList.indexOf(data.value) + 1);
|
|
|
|
+ paramsObject.selectedAnimationName = data.label;
|
|
} else {
|
|
} else {
|
|
navbar.updateParams({
|
|
navbar.updateParams({
|
|
- selectedAnimation: (this._animationList.indexOf(label) + 1),
|
|
|
|
- selectedAnimationName: label
|
|
|
|
|
|
+ selectedAnimation: (this._animationList.indexOf(data.value) + 1),
|
|
|
|
+ selectedAnimationName: data.label
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
@@ -363,7 +364,7 @@ export class DefaultViewer extends AbstractViewer {
|
|
animationIndex = 0;
|
|
animationIndex = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- this._updateAnimationType(animationNames[animationIndex], newParams);
|
|
|
|
|
|
+ this._updateAnimationType(newParams.animations[animationIndex], newParams);
|
|
} else {
|
|
} else {
|
|
newParams.animations = null;
|
|
newParams.animations = null;
|
|
}
|
|
}
|