We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

method to set full screen or "normal"

Answered
adriano.dorato@it-present.com asked on September 20, 2024

Is possible set fullscreen modal or normal via javscript coding?

5 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster September 23, 2024

Hello,

Thank you for writing to us.

To open fullscreen programmatically, we suggest using the following method:

flexmonster.toolbar.fullscreenHandler();

Please let us know if this works.

Best Regards,
Maksym

Public
adriano.dorato@it-present.com September 23, 2024

No, unfortunately!

Attachments:
doesentwork.png

Public
Maksym Diachenko Maksym Diachenko Flexmonster September 24, 2024

Hello,

Thank you for the reply and the details you provided.

In the screenshot, we noticed that the toolbar is disabled. This causes an error since, with a disabled toolbar, Flexmonster does not create an flexmonster.toolbar instance. As a result, all methods from the toolbar are unavailable. If you want to disable a toolbar and still access its methods, we recommend hiding it visually with CSS but enabling it by setting the toolbar: true option within new Flexmonster() constructor:

#fm-toolbar-wrapper {
height: 0 !important;
}

Here is a code sample that utilizes this approach to add an external fullscreen button: https://jsfiddle.net/flexmonster/0nzhb5rg/

Additionally, note that the toolbar is not immediately initialized upon loading the page. Based on the particular use case shown in your code, you can add flexmonster.toolbar.fullscreenHandler() to a click handler without significant precautions. However, if you want to open the fullscreen upon loading automatically, this should be done in Flexmonster's ready event handler, as this event signals that the component's initial configuration is completed.

Please let us know if our answer helped you.

Best Regards,
Maksym

Public
adriano.dorato@it-present.com September 24, 2024

OK,It's run! TNX

Public
Maksym Diachenko Maksym Diachenko Flexmonster September 25, 2024

Hello,

Thank you for your feedback.
We are glad to hear that our solution worked.
Feel free to contact us if more questions arise.

Best Regards,
Maksym

Please login or Register to Submit Answer