aurelia-v-grid / vGrid

Aurelia-v-grid - npm source
MIT License
49 stars 10 forks source link

use classList in createGridElement #40

Closed Thanood closed 8 years ago

Thanood commented 8 years ago

Comments here say you want to revisit that part again. :smile:

I'd propose using this.htmlCache.grid.classList.add(this.vGridConfig.css.wrapper) instead of setting the className to a single value so you "merge" with possible existing classes.

Could the position: relative part become a part of this.vGridConfig.css.wrapper?

Maybe instead of this.vGridElement.style.height/this.vGridElement.style.width use window.getComputedStyle(this.vGridElement).height so if no height is set, you'll get the actual computed height anyway.

On the other hand, maybe that's your intention to set to 100% of nothing is set.

vegarringdal commented 8 years ago

yes, code in the main buildup was old from another grid I made, dumped everything but them and forgot to update them.

regarding the create element function I have some bug, or there is something going on with custom elements I do not understand, since css do not behave correctly within them when I use create element and append child, that is the main reson why I have the element at all. Like the loadingscreen I had to put in a viewport and add it for it to behave like it should.

vegarringdal commented 8 years ago

Found out of all of my display issues, the main custom element for the grid didnt have "display:block", and since Im very bad at css/styling that problem have been plaguing me for 2 months.

hehe, display issues because I was missing the "display" in styles :joy:

Thanood commented 8 years ago

That missing display: block is a classic, at least for me. :smile: