@@ -1631,7 +1631,7 @@ MdPanelRef.prototype.destroy = function() {
16311631 this . config . onDomRemoved = null ;
16321632 this . config . onRemoving = null ;
16331633 this . config . onOpenComplete = null ;
1634- this . _interceptors = null ;
1634+ this . _interceptors = undefined ;
16351635} ;
16361636
16371637
@@ -1705,7 +1705,7 @@ MdPanelRef.prototype.hide = function() {
17051705 } ;
17061706 var removeFromGroupOpen = function ( ) {
17071707 if ( self . config . groupName ) {
1708- var group , index ;
1708+ var index ;
17091709 angular . forEach ( self . config . groupName , function ( group ) {
17101710 group = self . _$mdPanel . _groups [ group ] ;
17111711 index = group . openPanels . indexOf ( self ) ;
@@ -2320,34 +2320,34 @@ MdPanelRef.prototype._animateOpen = function() {
23202320
23212321/**
23222322 * 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.
23252324 * @private
23262325 */
23272326MdPanelRef . prototype . _animateClose = function ( ) {
2327+ var self = this ;
23282328 var animationConfig = this . config [ 'animation' ] ;
2329+
23292330 if ( ! animationConfig ) {
23302331 this . panelContainer . removeClass ( 'md-panel-is-showing' ) ;
23312332 this . panelContainer . removeClass ( '_md-panel-shown' ) ;
23322333 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+ } ;
23472347
2348- animationConfig . animateClose ( self . panelEl )
2349- . then ( done , warnAndClose ) ;
2350- } ) ;
2348+ animationConfig . animateClose ( self . panelEl ) . then ( done , warnAndClose ) ;
2349+ } ) ;
2350+ }
23512351} ;
23522352
23532353
@@ -2468,7 +2468,7 @@ MdPanelRef.prototype._simpleBind = function(callback, self) {
24682468
24692469
24702470/**
2471- * @param {function } callback
2471+ * @param {function|IQResolveReject } callback
24722472 * @param {!Object } self
24732473 * @return {function } Callback function with a self param.
24742474 */
@@ -2883,7 +2883,7 @@ MdPanelPosition.prototype.getRight = function() {
28832883
28842884/**
28852885 * Gets the value of `transform` for the panel.
2886- * @returns {string }
2886+ * @returns {string } representation of the translateX and translateY rules and values
28872887 */
28882888MdPanelPosition . prototype . getTransform = function ( ) {
28892889 var translateX = this . _reduceTranslateValues ( 'translateX' , this . _translateX ) ;
@@ -3370,8 +3370,7 @@ MdPanelAnimation.prototype.animateOpen = function(panelEl) {
33703370/**
33713371 * Animate the panel close.
33723372 * @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.
33753374 */
33763375MdPanelAnimation . prototype . animateClose = function ( panelEl ) {
33773376 var animator = this . _$mdUtil . dom . animator ;
@@ -3392,8 +3391,7 @@ MdPanelAnimation.prototype.animateClose = function(panelEl) {
33923391 transitionOutClass : '_md-panel-animate-enter _md-panel-animate-leave'
33933392 } ;
33943393
3395- var closeSlide = animator . calculateSlideToOrigin (
3396- panelEl , this . _closeTo ) || '' ;
3394+ var closeSlide = animator . calculateSlideToOrigin ( panelEl , this . _closeTo ) || '' ;
33973395 closeTo = animator . toTransformCss ( closeSlide + ' ' + panelTransform ) ;
33983396 break ;
33993397
@@ -3403,8 +3401,7 @@ MdPanelAnimation.prototype.animateClose = function(panelEl) {
34033401 transitionOutClass : '_md-panel-animate-scale-out _md-panel-animate-enter _md-panel-animate-leave'
34043402 } ;
34053403
3406- var closeScale = animator . calculateZoomToOrigin (
3407- panelEl , this . _closeTo ) || '' ;
3404+ var closeScale = animator . calculateZoomToOrigin ( panelEl , this . _closeTo ) || '' ;
34083405 closeTo = animator . toTransformCss ( panelTransform + ' ' + closeScale ) ;
34093406 break ;
34103407
@@ -3493,9 +3490,9 @@ function getElement(el) {
34933490
34943491/**
34953492 * 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
34973494 * @param {string } property
3498- * @return {{x: number, y: number} }
3495+ * @return {{x: number, y: number} } an element's translateX and translateY in px
34993496 */
35003497function getComputedTranslations ( el , property ) {
35013498 // The transform being returned by `getComputedStyle` is in the format:
0 commit comments