@@ -453,15 +453,15 @@ angular
453
453
* @returns {!MdPanelRef }
454
454
*/
455
455
456
- /**
457
- * @ngdoc method
458
- * @name MdPanelRef#updateAnimation
459
- * @description
460
- * Updates the animation configuration for a panel. You can use this to change
461
- * the panel's animation without having to re-create it.
462
- *
463
- * @param {!MdPanelAnimation } animation
464
- */
456
+ /**
457
+ * @ngdoc method
458
+ * @name MdPanelRef#updateAnimation
459
+ * @description
460
+ * Updates the animation configuration for a panel. You can use this to change
461
+ * the panel's animation without having to re-create it.
462
+ *
463
+ * @param {!MdPanelAnimation } animation
464
+ */
465
465
466
466
467
467
/*****************************************************************************
@@ -1108,6 +1108,9 @@ function MdPanelRef(config, $injector) {
1108
1108
/** @private @const {!angular.$mdUtil} */
1109
1109
this . _$mdUtil = $injector . get ( '$mdUtil' ) ;
1110
1110
1111
+ /** @private @const {!angular.$mdTheming} */
1112
+ this . _$mdTheming = $injector . get ( '$mdTheming' ) ;
1113
+
1111
1114
/** @private @const {!angular.Scope} */
1112
1115
this . _$rootScope = $injector . get ( '$rootScope' ) ;
1113
1116
@@ -1650,7 +1653,8 @@ MdPanelRef.prototype._createPanel = function() {
1650
1653
1651
1654
1652
1655
/**
1653
- * Adds the styles for the panel, such as positioning and z-index.
1656
+ * Adds the styles for the panel, such as positioning and z-index. Also,
1657
+ * themes the panel element and panel container using `$mdTheming`.
1654
1658
* @returns {!angular.$q.Promise<!MdPanelRef> }
1655
1659
* @private
1656
1660
*/
@@ -1661,9 +1665,13 @@ MdPanelRef.prototype._addStyles = function() {
1661
1665
self . panelEl . css ( 'z-index' , self . config [ 'zIndex' ] + 1 ) ;
1662
1666
1663
1667
var hideAndResolve = function ( ) {
1668
+ // Theme the element and container.
1669
+ self . _setTheming ( ) ;
1670
+
1664
1671
// Remove left: -9999px and add hidden class.
1665
1672
self . panelEl . css ( 'left' , '' ) ;
1666
1673
self . panelContainer . addClass ( MD_PANEL_HIDDEN ) ;
1674
+
1667
1675
resolve ( self ) ;
1668
1676
} ;
1669
1677
@@ -1679,17 +1687,31 @@ MdPanelRef.prototype._addStyles = function() {
1679
1687
return ; // Don't setup positioning.
1680
1688
}
1681
1689
1682
- // Wait for angular to finish processing the template, then position it
1683
- // correctly. This is necessary so that the panel will have a defined height
1684
- // and width.
1690
+ // Wait for angular to finish processing the template
1685
1691
self . _$rootScope [ '$$postDigest' ] ( function ( ) {
1692
+ // Position it correctly. This is necessary so that the panel will have a
1693
+ // defined height and width.
1686
1694
self . _updatePosition ( true ) ;
1695
+
1696
+ // Theme the element and container.
1697
+ self . _setTheming ( ) ;
1698
+
1687
1699
resolve ( self ) ;
1688
1700
} ) ;
1689
1701
} ) ;
1690
1702
} ;
1691
1703
1692
1704
1705
+ /**
1706
+ * Sets the `$mdTheming` classes on the `panelContainer` and `panelEl`.
1707
+ * @private
1708
+ */
1709
+ MdPanelRef . prototype . _setTheming = function ( ) {
1710
+ this . _$mdTheming ( this . panelEl ) ;
1711
+ this . _$mdTheming ( this . panelContainer ) ;
1712
+ } ;
1713
+
1714
+
1693
1715
/**
1694
1716
* Updates the position configuration of a panel
1695
1717
* @param {!MdPanelPosition } position
@@ -2210,6 +2232,7 @@ MdPanelRef.prototype.removeFromGroup = function(groupName) {
2210
2232
}
2211
2233
} ;
2212
2234
2235
+
2213
2236
/**
2214
2237
* Possible default closeReasons for the close function.
2215
2238
* @enum {string}
@@ -2219,6 +2242,7 @@ MdPanelRef.closeReasons = {
2219
2242
ESCAPE : 'escapeToClose' ,
2220
2243
} ;
2221
2244
2245
+
2222
2246
/*****************************************************************************
2223
2247
* MdPanelPosition *
2224
2248
*****************************************************************************/
0 commit comments