magpie-ea / magpie-modules

the reusable front-end bits in the _magpie modules
MIT License
7 stars 1 forks source link

Picture container should not occupy space if there is no picture in a view #49

Open JannisBush opened 5 years ago

JannisBush commented 5 years ago

If the picture-argument is empty in a view, the picture container should not take up space

JannisBush commented 5 years ago

We could do something like this:

babe-view-stimulus-container {
    height: auto;
    max-height: 350px;
}

Now, the picture (or better) the stimulus container does not occupy any space if it is empty. The problem is, if there are two trials in a row with different image sizes, e.g. one with 350px height and one with 200px height, the answer container will "jump" around and distract the participant. Another problem is that the fixation point won't be correctly located anymore.

I don't know how to make the stimulus container 350px height, if there is something inside and 0px height if there is nothing inside, using CSS.

Maybe, we could adjust the style (to height: 0px) in the render function of each view, if it has no picture/canvas stimuli.