LiteMol icon indicating copy to clipboard operation
LiteMol copied to clipboard

bootstrap 5 - layout problem

Open hegelab opened this issue 3 years ago • 4 comments

Hi,

If I use bootstrap 5 then litemol plugin's div covers the full screen.

<div class="col-6">somthing</div>
<div class="col-6"><div id="litemol"</div></div>

Do you have any solution? Thanks, Tamas

hegelab avatar Jan 14 '22 18:01 hegelab

Hi, I am pretty sure you can tweak the CSS of the litemol element to fit inline. Also, when you create the instance of the plugin, do you set the expanded property to true or false?

dsehnal avatar Jan 14 '22 18:01 dsehnal

I tried to have <span> instead of <div> and also tried to set class=d-inline - did not work

I do not see expanded property in create: https://webchemdev.ncbr.muni.cz/LiteMol/SourceDocs/interfaces/litemol.plugin.plugincontrolleroptions.html I found layoutState : {isExpanded} I tried all variations, including:

let plugin = LiteMol.Plugin.create({
        target: '#litemol',
        viewportBackground: '#ffffff',
        layoutState: { hideControls: true, expanded: false }
    });

hegelab avatar Jan 14 '22 21:01 hegelab

Sorry the property is called isExpanded indeed.

LiteMol.Plugin.create({
        target: '#litemol',
        viewportBackground: '#ffffff',
        layoutState: { hideControls: true, isExpanded: false }
    });

It's same usage as for example in https://github.com/dsehnal/LiteMol/blob/2ce0190a9b369841c1c3ee7322c2f5dda3e7800e/examples/Transforms/src/App.ts#L12

You can also try:

<div class="col-6" style="position: relative"><div id="litemol"></div></div>

The lack of relative position on the parent is probably what's causing your issue.

dsehnal avatar Jan 15 '22 09:01 dsehnal

style="position: relative" solved this issue. Thanks a lot!

hegelab avatar Jan 15 '22 10:01 hegelab