openlexington / gethelplex

Substance use treatment locator for Lexington, KY
http://gethelplex.org
MIT License
161 stars 22 forks source link

highlighting alternating rows is inconsistent #27

Open chaserx opened 9 years ago

chaserx commented 9 years ago

I think the intent of the updated styling was to highlight alternate rows, but it seems (see screengrab) that it's not being applied consistently or that the order loading results is not as expected when this styling is applied.

screen shot 2015-10-14 at 1 16 02 pm

jbonewits commented 9 years ago

So this works as expected if there are no filters selected. Perhaps something about the order of when the highlighting is being applied relative to the filters is causing this behavior.

screen shot 2015-10-20 at 7 11 25 pm
ashleybot commented 9 years ago

So, the alternating backgrounds are achieved with CSS nth-child selectors. The styling appears to not update it's alternating appearance because elements are hidden (display:none) rather than removed. So, the CSS rules maintain.

So, one solution would be to purposely create .odd or .even CSS classes, assign them appropriately whenever the list is created/filtered.

eeeschwartz commented 8 years ago

Currently, the list items that are visibly filtered out with style="display:none".

Let's instead toggle a class for hidden/visible. Then we could only target the visible items with the nth-child selector.