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.
In the HTML I see that the buttons are still giving a css tag display: none
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?
I found that it also works properly on my Android 6.0 device with the Google Chrome and the viewer v2.13. I have no explanation for the visibility of the button control in your device.
If you can provide a reproducible case demonstrating that, I will gladly pass it on to the development team for analysis. Those following items should be in the reproducible case:
If your reproducible case could not be posted here publicly, please send it to the forge.help@autodesk.com
and remove sensitive data or information before you send .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.