@@ -1631,7 +1631,7 @@ MdPanelRef.prototype.destroy = function() {
1631
1631
this . config . onDomRemoved = null ;
1632
1632
this . config . onRemoving = null ;
1633
1633
this . config . onOpenComplete = null ;
1634
- this . _interceptors = null ;
1634
+ this . _interceptors = undefined ;
1635
1635
} ;
1636
1636
1637
1637
@@ -1705,7 +1705,7 @@ MdPanelRef.prototype.hide = function() {
1705
1705
} ;
1706
1706
var removeFromGroupOpen = function ( ) {
1707
1707
if ( self . config . groupName ) {
1708
- var group , index ;
1708
+ var index ;
1709
1709
angular . forEach ( self . config . groupName , function ( group ) {
1710
1710
group = self . _$mdPanel . _groups [ group ] ;
1711
1711
index = group . openPanels . indexOf ( self ) ;
@@ -2320,34 +2320,34 @@ MdPanelRef.prototype._animateOpen = function() {
2320
2320
2321
2321
/**
2322
2322
* Animate the panel closing.
2323
- * @returns {!Q.IPromise } A promise that is resolved when the panel has
2324
- * animated closed.
2323
+ * @returns {!Q.IPromise } A promise that is resolved when the panel has animated closed.
2325
2324
* @private
2326
2325
*/
2327
2326
MdPanelRef . prototype . _animateClose = function ( ) {
2327
+ var self = this ;
2328
2328
var animationConfig = this . config [ 'animation' ] ;
2329
+
2329
2330
if ( ! animationConfig ) {
2330
2331
this . panelContainer . removeClass ( 'md-panel-is-showing' ) ;
2331
2332
this . panelContainer . removeClass ( '_md-panel-shown' ) ;
2332
2333
return this . _$q . when ( this ) ;
2333
- }
2334
-
2335
- var self = this ;
2336
- return this . _$q ( function ( resolve ) {
2337
- var done = function ( ) {
2338
- self . panelContainer . removeClass ( 'md-panel-is-showing' ) ;
2339
- resolve ( self ) ;
2340
- } ;
2341
- var warnAndClose = function ( ) {
2342
- self . _$log . warn (
2343
- 'mdPanel: MdPanel Animations failed. ' +
2344
- 'Hiding panel without animating.' ) ;
2345
- done ( ) ;
2346
- } ;
2334
+ } else {
2335
+ return this . _$q ( function ( resolve ) {
2336
+ var done = function ( ) {
2337
+ self . panelContainer . removeClass ( 'md-panel-is-showing' ) ;
2338
+ // Remove the transform so that re-used panels don't accumulate transforms.
2339
+ self . panelEl . css ( 'transform' , '' ) ;
2340
+ resolve ( self ) ;
2341
+ } ;
2342
+ var warnAndClose = function ( ) {
2343
+ self . _$log . warn (
2344
+ 'mdPanel: MdPanel Animations failed. Hiding panel without animating.' ) ;
2345
+ done ( ) ;
2346
+ } ;
2347
2347
2348
- animationConfig . animateClose ( self . panelEl )
2349
- . then ( done , warnAndClose ) ;
2350
- } ) ;
2348
+ animationConfig . animateClose ( self . panelEl ) . then ( done , warnAndClose ) ;
2349
+ } ) ;
2350
+ }
2351
2351
} ;
2352
2352
2353
2353
@@ -2468,7 +2468,7 @@ MdPanelRef.prototype._simpleBind = function(callback, self) {
2468
2468
2469
2469
2470
2470
/**
2471
- * @param {function } callback
2471
+ * @param {function|IQResolveReject } callback
2472
2472
* @param {!Object } self
2473
2473
* @return {function } Callback function with a self param.
2474
2474
*/
@@ -2883,7 +2883,7 @@ MdPanelPosition.prototype.getRight = function() {
2883
2883
2884
2884
/**
2885
2885
* Gets the value of `transform` for the panel.
2886
- * @returns {string }
2886
+ * @returns {string } representation of the translateX and translateY rules and values
2887
2887
*/
2888
2888
MdPanelPosition . prototype . getTransform = function ( ) {
2889
2889
var translateX = this . _reduceTranslateValues ( 'translateX' , this . _translateX ) ;
@@ -3370,8 +3370,7 @@ MdPanelAnimation.prototype.animateOpen = function(panelEl) {
3370
3370
/**
3371
3371
* Animate the panel close.
3372
3372
* @param {!JQLite } panelEl
3373
- * @returns {!Q.IPromise } A promise that resolves when the close
3374
- * animation is complete.
3373
+ * @returns {!Q.IPromise } A promise that resolves when the close animation is complete.
3375
3374
*/
3376
3375
MdPanelAnimation . prototype . animateClose = function ( panelEl ) {
3377
3376
var animator = this . _$mdUtil . dom . animator ;
@@ -3392,8 +3391,7 @@ MdPanelAnimation.prototype.animateClose = function(panelEl) {
3392
3391
transitionOutClass : '_md-panel-animate-enter _md-panel-animate-leave'
3393
3392
} ;
3394
3393
3395
- var closeSlide = animator . calculateSlideToOrigin (
3396
- panelEl , this . _closeTo ) || '' ;
3394
+ var closeSlide = animator . calculateSlideToOrigin ( panelEl , this . _closeTo ) || '' ;
3397
3395
closeTo = animator . toTransformCss ( closeSlide + ' ' + panelTransform ) ;
3398
3396
break ;
3399
3397
@@ -3403,8 +3401,7 @@ MdPanelAnimation.prototype.animateClose = function(panelEl) {
3403
3401
transitionOutClass : '_md-panel-animate-scale-out _md-panel-animate-enter _md-panel-animate-leave'
3404
3402
} ;
3405
3403
3406
- var closeScale = animator . calculateZoomToOrigin (
3407
- panelEl , this . _closeTo ) || '' ;
3404
+ var closeScale = animator . calculateZoomToOrigin ( panelEl , this . _closeTo ) || '' ;
3408
3405
closeTo = animator . toTransformCss ( panelTransform + ' ' + closeScale ) ;
3409
3406
break ;
3410
3407
@@ -3493,9 +3490,9 @@ function getElement(el) {
3493
3490
3494
3491
/**
3495
3492
* Gets the computed values for an element's translateX and translateY in px.
3496
- * @param {!JQLite|!Element } el
3493
+ * @param {!JQLite|!Element } el the element to evaluate
3497
3494
* @param {string } property
3498
- * @return {{x: number, y: number} }
3495
+ * @return {{x: number, y: number} } an element's translateX and translateY in px
3499
3496
*/
3500
3497
function getComputedTranslations ( el , property ) {
3501
3498
// The transform being returned by `getComputedStyle` is in the format:
0 commit comments