Skip to content
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

Merged
merged 8 commits into from Jan 12, 2015

Conversation

fjarrett
Copy link
Contributor

Resolves #675

@shadyvb please review


$rows.removeClass( 'alternate' );

$rows.each( function() {
Copy link
Contributor

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' );
}

Copy link
Contributor Author

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.

Copy link
Contributor

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' );

Copy link
Contributor Author

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

@fjarrett fjarrett assigned lukecarbis and unassigned shadyvb Dec 30, 2014
fjarrett added a commit that referenced this pull request Jan 12, 2015
Only apply live updates during main query and fix dashboard live updates bug
@fjarrett fjarrett merged commit dc6e551 into develop Jan 12, 2015
@fjarrett fjarrett deleted the issue-675 branch January 12, 2015 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Live updates should behave differently when filtering results
3 participants