1

I am using forge viewer version v6.4 for the rme_advanced_sample_project sample model. When I resize my Chrome browser to a relative small size (600px in width), I discovered that some of the toolbar buttons are disappeared from the viewer.

When I check the debug console, I can see that those buttons has a CSS property of display: "none" assigned to them after the resize. When I change the value of those to display: "block" again, which is the original value before resizing, I am able to see the buttons again.

Attached with some screenshots for your reference:

Before: enter image description here

After resizing to a small size (~600px in width): enter image description here

After setting the css of the buttons: enter image description here

I would like to know if there is a way to disable such behaviour so that all the toolbar buttons will always be shown? Thanks!

1 Answer 1

1

To keep those buttons visible at all times you can override the display setting in your stylesheet like below:

#YourViewerDiv #navTools #toolbar-panTool{display:block !important} //Inspect in browser console and apply the same to the other buttons you'd like to keep visible 

Alternatively for a programmatic approach, the offending code for this behavior:

//GuiViewer.js this.addEventListener(et.VIEWER_RESIZE_EVENT, function (event) { viewer.resizePanels(); if (viewer.viewCubeUi && viewer.viewCubeUi.cube) viewer.viewCubeUi.cube.refreshCube(); viewer.updateToolbarButtons(event.width, event.height); }); 

So you suppress it in your own listener by always resizeing to a wide enough width:

viewer.addEventListener(Autodesk.Viewing.VIEWER_RESIZE_EVENT, ()=>viewer.updateToolbarButtons(1000,1000)) 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.