Forge Viewer toolbar buttons not hiding on mobile phone screen

时间:2017-06-15 09:53:49

标签: javascript css autodesk-forge autodesk

I am trying to adjust the buttons to only show the navigation tools when the device is a mobile phone. I'm using the following code:

  viewer.toolbar.getControl('settingsTools').setVisible(false);
  viewer.toolbar.getControl('modelTools').setVisible(false);
  viewer.toolbar.getControl('navTools').setVisible(true);
  viewer.toolbar.getControl('navTools').getControl('toolbar-orbitTools').setVisible(true);

But then it will remove the visible buttons which were the SettingsTools and half of the modelTools. But it won't show the navTools.

enter image description here

In the HTML I see that the buttons are still giving a css tag display: none

enter image description here

How can I make this work?

EDIT: I have changed the logic to directly change the CSS (display = none or block) as per this example http://through-the-interface.typepad.com/through_the_interface/2017/03/hiding-unwanted-toolbar-items-in-the-forge-viewer.html.

Using this causes the button to be arranged and styled weird. Is there a method I need to call to let the viewer update its outlining etc?

enter image description here

1 个答案:

答案 0 :(得分:0)

我发现它在使用Google Chrome和查看器v2.13的Android 6.0设备上也能正常运行。我没有解释设备中按钮控件的可见性。

如果您能提供可重复的案例证明,我很乐意将其传递给开发团队进行分析。以下项目应在可重现的案例中:

  1. 简短确切描述您要实现的目标。您观察到的行为与您的期望,以及为什么这是一个问题。
  2. 用于运行测试的完整但最小的样本源模型。
  3. 一个完整但极简的Forge应用程序,可以使用一个简单的程序运行和调试,以便在样本模型中分析其行为。
  4. 有关复制问题的详细逐步说明,例如:选择哪个元素,启动什么命令等。
  5. 如果您的可复制案例无法在此公开发布,请在发送之前将其发送至forge.help@autodesk.com删除敏感数据或信息。