Problem/Motivation
In #1649780: Remove first/last/odd/even classes in favor of CSS3 pseudo selectors the odd/even selectors in the Views dialog were updated to use CSS3 selectors. However, this is incompatible with striping in the Views dialog. Elements are hidden, but CSS makes no distinction between hidden and visible elements in the selector .views-filterable-options .filterable-option:nth-of-type(even) .form-type-checkbox {
Proposed resolution
Fix the restriping on the Views dialog filter
Remaining tasks
- Write a patch
- Review
User interface changes
Views filtered rows are restriped when filtering
API changes
None
Comment | File | Size | Author |
---|---|---|---|
#9 | interdiff-9-1.txt | 1.41 KB | idebr |
#9 | 2442999-9.patch | 1.96 KB | idebr |
#1 | 2442999-1.patch | 1.84 KB | idebr |
views-dialog-restriping-before.gif | 51.97 KB | idebr |
Comments
Comment #1
idebr CreditAttribution: idebr commentedAttached patch reintroduces some of the scripting for Views in Drupal 7 to fix the striping. The striping is currently only applied for javascript users, so I didn't change the original table rendering.
Comment #2
bfr CreditAttribution: bfr commentedSeems good to me.
Comment #3
Manuel Garcia CreditAttribution: Manuel Garcia commentedThis looks good to me, i've been testing it manually, and actualy before we werent even handling this case at all.
This was not doing anything before, but with this patch it is necessary.
Comment #4
dawehnerGiven my limited CSS knowledge, I'm curios, whether the filtering itself could add a class for hidden/not hidden rows and then we use that in the CSS to change the style?
Comment #5
LewisNyman@dawehner Yes, I think we could use a :not(selector) here in theory, but we need to try it in practice, so setting to needs work. It would be a shame to introduce Javascript functionality just for this particular use case, and there an argument whether we need the zebra striping at all, as the Seven style guide remove this in favour of a hover color.
Comment #6
Manuel Garcia CreditAttribution: Manuel Garcia commentedThe problem here is that we can't use
:nth-of-type(even)
selector along with:not(selector)
... they won't work together unfortunately.So I don't see any other way around this, unless we indeed drop the zebra striping altogether.
Comment #7
idebr CreditAttribution: idebr commentedHow about we fix the regression first with javascript and continue the discussion on removing the striping in a followup?
Comment #8
nod_Looks ok, can you just move the show() after classes have been messed with? Also since we're messing with things in this function can you reformat the variable declarations to be more in line with the rest:
Transformed to :
And remove those variable from the declaration in the first line.
Comment #9
idebr CreditAttribution: idebr commented@nod_ Thanks for the review, would lottery again :)
I updated the variable declaration and moved .show().
Comment #10
nod_Thanks :) that works.
Comment #11
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 4a7ab3e and pushed to 8.0.x. Thanks!