wanadev / PhotonUI

A javascript framework to create user interfaces
http://wanadev.github.io/PhotonUI/
BSD 3-Clause "New" or "Revised" License
63 stars 20 forks source link

photonui.Slider: the visible property has no effect #40

Closed flozz closed 8 years ago

flozz commented 8 years ago

Nothing happen when setting the visible property of the photonui.Sliderto false. This is caused by a display: flex !important; in the CSS...

Example code to reproduce:

var slider = new photonui.Slider({
    fieldVisible: true,
    min: 0, max: 100,
    step: 10,
    value: 50,
    visible: false
 });

Expected: Slider should not be displayed. Current Result: The slider is visible.

MangelMaxime commented 8 years ago

I just made some really little test and why not just removing the !important in the CSS ?

By removing it it's working as expected. I just tested it with nothing fancy for the moment.

flozz commented 8 years ago

If my memory is good, the !important was added because one of the layouts break the slider by overriding the display property of its children...

flozz commented 8 years ago

It is the BoxLayouthttps://github.com/wanadev/PhotonUI/blob/master/less/base/layout/boxlayout.less#L57

But it does this for a good reason too... I will have to make some tests to fix that...