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

feat(sort): add sorting indicator animation #5831

Merged
merged 4 commits into from
Aug 30, 2017
Merged

feat(sort): add sorting indicator animation #5831

merged 4 commits into from
Aug 30, 2017

Conversation

yhorbachov
Copy link
Contributor

Uses @angular/animations module to animate sort order change.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 17, 2017
@yhorbachov yhorbachov closed this Jul 18, 2017
@yhorbachov yhorbachov reopened this Jul 18, 2017
@jelbourn
Copy link
Member

@andrewseguin can you check with the Material Design UX team whether the sort header should have an animation and what that animation should be?

@andrewseguin
Copy link
Contributor

Checked with the spec, it should rotate when the sort changes. Will check out the PR soon

@@ -7,8 +7,7 @@

<div *ngIf="_isSorted()"
class="mat-sort-header-arrow"
[class.mat-sort-header-asc]="_sort.direction == 'asc'"
[class.mat-sort-header-desc]="_sort.direction == 'desc'">
[@indicatorRotate]="_getSortingState()">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can just use _sort.direction without needing a function

trigger('indicatorRotate', [
state('asc', style({transform: 'rotate(45deg)'})),
state('desc', style({transform: 'rotate(225deg)'})),
/** Use standart animation curve from material guidelines */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove comment

state('asc', style({transform: 'rotate(45deg)'})),
state('desc', style({transform: 'rotate(225deg)'})),
/** Use standart animation curve from material guidelines */
transition('asc <=> desc', animate('225ms cubic-bezier(0.4,0.0,0.2,1)'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs spaces between the numbers: cubic-bezier(0.4, 0.0, 0.2, 1);

@andrewseguin
Copy link
Contributor

Looks good, just a few comments. Thanks for the PR - animations look good

@andrewseguin andrewseguin added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Aug 8, 2017
@mmalerba
Copy link
Contributor

mmalerba commented Aug 8, 2017

@KillaBee1985 can you squash this down into a single commit? Our presubmit script doesn't like the merge commits

@@ -7,8 +7,7 @@

<div *ngIf="_isSorted()"
class="mat-sort-header-arrow"
[class.mat-sort-header-asc]="_sort.direction == 'asc'"
[class.mat-sort-header-desc]="_sort.direction == 'desc'">
[@indicatorRotate]="this._sort.direction">
Copy link
Contributor

@rafaelss95 rafaelss95 Aug 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the use of this in template is valid (until now), it may be broken in future angular versions, since it's not even documented. Btw, I could not find the question I had seen in SO that discussed this better.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yhorbachov
Copy link
Contributor Author

@mmalerba, I removed all merges and left only my commits. Is it ok?

@mmalerba
Copy link
Contributor

yep, that works too!

@andrewseguin
Copy link
Contributor

Please rebase

@rafaelss95
Copy link
Contributor

@KillaBee1985 can you rebase this? So we can get this merged.

@yhorbachov
Copy link
Contributor Author

@rafaelss95 Done.

@jelbourn jelbourn merged commit 70bd5fc into angular:master Aug 30, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants