New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only apply live updates during main query and fix dashboard live updates bug #676
Conversation
|
||
$rows.removeClass( 'alternate' ); | ||
|
||
$rows.each( function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work?
$row.each( function( index ) {
$( this ).addClass( index % 2 ? '' : 'alternate' );
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lukecarbis We need to also remove the class from existing rows that may already have it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't that happen on line 71? https://github.com/wp-stream/stream/pull/676/files#diff-959e4b03f08d6986c43c1046113e3de4R72
If not, just do this instead:
$( this ).removeClass( 'alternate' ).addClass( index % 2 ? '' : 'alternate' );
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lukecarbis Oh you are totally right! Nice one. Done in 4b08d8e
Only apply live updates during main query and fix dashboard live updates bug
Resolves #675
@shadyvb please review