Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

fix(dialog, menu, select, interimElement): use $animateCss instead of transitionEnd events. #3949

Closed
wants to merge 1 commit into from

Conversation

ThomasBurleson
Copy link
Contributor

Replace programmatic use of element.css for style changes and use of transitionEnd event listeners with use of ngAnimate's $animateCss; use $animateCss polyfill for Angular versions < 1.4.x

  • $mdUtil.dom.animator.translate3d() uses $animateCss() instead of waitTransitionEnd()
  • use animateCss.js polyfill for 'material.animate' module
  • add mock createMockStyleSheet for animateCss tests
  • refactors to menu-interim-element.js and select.js
  • refactor logic and patterns used
  • use $animateCss in place of waitTransitionEnd()
  • debounce Select and Menu window resize handlers
  • Dialog uses same showBackdrop/hideBackdrop pattern as Menu and Select
  • disable scroll before creating the backdrop
  • select async demo no longer clears users list when reloading
  • select demos use md-input-container { margin-right: 10px;}
  • hide Select Backdrop with zero duration
  • enable full click detection in select-value area by using background color (with zero alpa).
  • update use of $$rAF and $timeout in Jasmine tests
  • use $animateCss to animate the dropdown leave.
  • Jasmine tests disable animation transitions for Toast and Select

BREAKING-CHANGES: select and backdrop styles added

  • select list text is not selectable,
  • select backdrop hide duration is 0ms
  • select text value background has zero alpha
.md-text {
  @include not-selectable();
}

.md-select-value {
  background-color: rgba(0,0,0,0);
}

md-backdrop {
  &.md-select-backdrop {
      transition-duration: 0ms;
  }
}

Fixes #3919. Fixes #3837. Fixes #3773, Fixes #3640. Fixes #3527. Fixes #3653.

@ThomasBurleson
Copy link
Contributor Author

@jelbourn @robertmesserle @matsko @rschmukler - For your review. This code works great at runtime with Angular 1.3.15 and Angular 1.4.3.

@matsko - Unfortunately the Karma tests fail when testing with Angular 1.3.15, so we are unable to merge until this is resolved.

@matsko
Copy link
Contributor

matsko commented Jul 29, 2015

Ok I will figure this out tonight
On Jul 29, 2015 6:30 PM, "Thomas Burleson" [email protected] wrote:

@jelbourn https://github.com/jelbourn @robertmesserle
https://github.com/robertmesserle @matsko https://github.com/matsko
@rschmukler https://github.com/rschmukler - For your review. This code
works great at runtime with Angular 1.3.15 and Angular 1.4.3.

@matsko https://github.com/matsko - Unfortunately the Karma tests fail
when testing with Angular 1.3.15, so we are unable to merge until this is
resolved.


Reply to this email directly or view it on GitHub
#3949 (comment).

@@ -3,7 +3,7 @@ var fs = require('fs');
var versionFile = __dirname + '/../dist/commit';

module.exports = {
ngVersion: '1.4.3',
ngVersion: '1.3.15',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will not be merged; it is, however, useful for testing the Karma failures with Angular 1.3.x

@ThomasBurleson
Copy link
Contributor Author

@matsko - to be clear:

  • Use Angular 1.3.15 in our local Documentation SPA works as expected without any [apparent] issues
  • Using Angular 1.4.3 in our local Documentation SPA works as expected without any [apparent] issues
  • Running the Material Karma tests with Angular 1.4.3 passes all tests
  • Running the Material Karma tests with Angular 1.3.15 FAILS many of the tests.

@ThomasBurleson ThomasBurleson added this to the 0.11.0 milestone Jul 30, 2015
@ThomasBurleson ThomasBurleson self-assigned this Jul 30, 2015
$rootScope.$apply();
$$rAF.flush();
} finally {
$timeout.flush();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to check if this finally is still needed.

@@ -5,6 +5,7 @@ md-backdrop {
}
&.md-select-backdrop {
z-index: $z-index-dialog + 1;
transition-duration: 0ms;
Copy link
Member

Choose a reason for hiding this comment

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

Just 0

$animateCss(element, {
addClass : 'md-active',
from : animator.toCss( position ),
to : animator.toCss( { transform : 'scale(1.0,1.0)' })
Copy link
Member

Choose a reason for hiding this comment

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

Remove extra spaces from inside object literal (here and elsewhere). E.g.,
animator.toCss({transform: 'scale(1.0,1.0)'})

@ThomasBurleson
Copy link
Contributor Author

@jelbourn - All (99%) your comments have been addressed.

@ThomasBurleson
Copy link
Contributor Author

@matsko - great work with $animateCss

… transitionEnd events.

replace programmatic use of element.css for style changes and use of transitionEnd event listeners with use of ngAnimate's $animateCss; use polyfill for Angular <1.4.

*  $mdUtil.dom.animator.translate3d() uses $animateCss() instead of waitTransitionEnd()
*  use animateCss.js polyfill for 'material.animate' module
  *  add mock `createMockStyleSheet` for animateCss tests
*  refactors to menu-interim-element.js and select.js
  *  refactor logic and patterns used
  *  use $animateCss in place of waitTransitionEnd()
*  debounce Select and Menu window resize handlers
*  Dialog uses same showBackdrop/hideBackdrop pattern as Menu and Select
  *  disable scroll before creating the backdrop
*  select async demo no longer clears users list when reloading
*  select demos use `md-input-container { margin-right: 10px;}`
*  hide Select Backdrop with zero duration
*  enable full click detection in select-value area by using background color (with zero alpa).
*  update use of $$rAF and $timeout in Jasmine tests
*  use $animateCss to animate the dropdown leave.
*  Jasmine tests disable animation transitions for Toast and Select

BREAKING-CHANGES:  select and backdrop styles added

*  select list text is not selectable,
*  select backdrop hide duration is 0ms
*  select text value background has zero alpha

```scss
.md-text {
  @include not-selectable();
}

.md-select-value {
  background-color: rgba(0,0,0,0);
}

md-backdrop {
  &.md-select-backdrop {
      transition-duration: 0ms;
  }
}
```

Fixes #3919. Fixes #3837. Fixes #3773, Fixes #3640. Fixes #3527. Fixes #3653.
@ThomasBurleson ThomasBurleson removed the pr: merge ready This PR is ready for a caretaker to review label Aug 6, 2015
kennethcachia pushed a commit to kennethcachia/material that referenced this pull request Sep 23, 2015
… transitionEnd events.

replace programmatic use of element.css for style changes and use of transitionEnd event listeners with use of ngAnimate's $animateCss; use polyfill for Angular <1.4.

*  $mdUtil.dom.animator.translate3d() uses $animateCss() instead of waitTransitionEnd()
*  use animateCss.js polyfill for 'material.animate' module
  *  add mock `createMockStyleSheet` for animateCss tests
*  refactors to menu-interim-element.js and select.js
  *  refactor logic and patterns used
  *  use $animateCss in place of waitTransitionEnd()
*  debounce Select and Menu window resize handlers
*  Dialog uses same showBackdrop/hideBackdrop pattern as Menu and Select
  *  disable scroll before creating the backdrop
*  select async demo no longer clears users list when reloading
*  select demos use `md-input-container { margin-right: 10px;}`
*  hide Select Backdrop with zero duration
*  enable full click detection in select-value area by using background color (with zero alpa).
*  update use of $$rAF and $timeout in Jasmine tests
*  use $animateCss to animate the dropdown leave.
*  Jasmine tests disable animation transitions for Toast and Select

BREAKING-CHANGES:  select and backdrop styles added

*  select list text is not selectable,
*  select backdrop hide duration is 0ms
*  select text value background has zero alpha

```scss
.md-text {
  @include not-selectable();
}

.md-select-value {
  background-color: rgba(0,0,0,0);
}

md-backdrop {
  &.md-select-backdrop {
      transition-duration: 0ms;
  }
}
```

Fixes angular#3919. Fixes angular#3837. Fixes angular#3773, Fixes angular#3640. Fixes angular#3527. Fixes angular#3653. Closes angular#3949.
@EladBezalel EladBezalel deleted the wip/use_animatecss branch January 16, 2016 00:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants