@@ -96,6 +96,9 @@ angular
96
96
* controller.
97
97
* - `controllerAs` - `{string=}`: An alias to assign the controller to on
98
98
* the scope.
99
+ * - `bindToController` - `{boolean=}`: Binds locals to the controller
100
+ * instead of passing them in. Defaults to true, as this is a best
101
+ * practice.
99
102
* - `locals` - `{Object=}`: An object containing key/value pairs. The keys
100
103
* will be used as names of values to inject into the controller. For
101
104
* example, `locals: {three: 3}` would inject `three` into the controller,
@@ -107,6 +110,8 @@ angular
107
110
* application.
108
111
* - `panelClass` - `{string=}`: A css class to apply to the panel element.
109
112
* This class should define any borders, box-shadow, etc. for the panel.
113
+ * - `zIndex` - `{number=}`: The z-index to place the panel at.
114
+ * Defaults to 80.
110
115
* - `position` - `{MdPanelPosition=}`: An MdPanelPosition object that
111
116
* specifies the alignment of the panel. For more information, see
112
117
* `MdPanelPosition`.
@@ -141,7 +146,8 @@ angular
141
146
* panel is removed from the DOM.
142
147
* - `origin` - `{(string|!angular.JQLite|!Element)=}`: The element to
143
148
* focus on when the panel closes. This is commonly the element which triggered
144
- * the opening of the panel.
149
+ * the opening of the panel. If you do not use `origin`, you need to control
150
+ * the focus manually.
145
151
*
146
152
* TODO(ErinCoughlan): Add the following config options.
147
153
* - `groupName` - `{string=}`: Name of panel groups. This group name is
@@ -286,6 +292,13 @@ angular
286
292
* hidden and animations are completed.
287
293
*/
288
294
295
+ /**
296
+ * @ngdoc method
297
+ * @name MdPanelRef#destroy
298
+ * @description
299
+ * Destroys the panel. The panel cannot be opened again after this is called.
300
+ */
301
+
289
302
/**
290
303
* @ngdoc method
291
304
* @name MdPanelRef#addClass
@@ -622,16 +635,16 @@ function MdPanelService($rootElement, $rootScope, $injector, $window) {
622
635
this . _config = { } ;
623
636
624
637
/** @private @const */
625
- this . _$rootScope = $rootScope ;
638
+ this . _$rootElement = $rootElement ;
626
639
627
640
/** @private @const */
628
- this . _$rootElement = $rootElement ;
641
+ this . _$rootScope = $rootScope ;
629
642
630
643
/** @private @const */
631
644
this . _$injector = $injector ;
632
645
633
- /** @private @const {!angular.$window} */
634
- this . _$window = $injector . get ( '$ window' ) ;
646
+ /** @private @const */
647
+ this . _$window = $window ;
635
648
636
649
637
650
/**
@@ -1173,15 +1186,17 @@ MdPanelRef.prototype._addStyles = function() {
1173
1186
MdPanelRef . prototype . _updatePosition = function ( ) {
1174
1187
var positionConfig = this . _config [ 'position' ] ;
1175
1188
1176
- positionConfig . _setPanelPosition ( this . _panelEl ) ;
1177
- this . _panelEl . css ( 'top' , positionConfig . getTop ( ) ) ;
1178
- this . _panelEl . css ( 'bottom' , positionConfig . getBottom ( ) ) ;
1179
- this . _panelEl . css ( 'left' , positionConfig . getLeft ( ) ) ;
1180
- this . _panelEl . css ( 'right' , positionConfig . getRight ( ) ) ;
1189
+ if ( positionConfig ) {
1190
+ positionConfig . _setPanelPosition ( this . _panelEl ) ;
1191
+ this . _panelEl . css ( 'top' , positionConfig . getTop ( ) ) ;
1192
+ this . _panelEl . css ( 'bottom' , positionConfig . getBottom ( ) ) ;
1193
+ this . _panelEl . css ( 'left' , positionConfig . getLeft ( ) ) ;
1194
+ this . _panelEl . css ( 'right' , positionConfig . getRight ( ) ) ;
1181
1195
1182
- // Use the vendor prefixed version of transform.
1183
- var prefixedTransform = this . _$mdConstant . CSS . TRANSFORM ;
1184
- this . _panelEl . css ( prefixedTransform , positionConfig . getTransform ( ) ) ;
1196
+ // Use the vendor prefixed version of transform.
1197
+ var prefixedTransform = this . _$mdConstant . CSS . TRANSFORM ;
1198
+ this . _panelEl . css ( prefixedTransform , positionConfig . getTransform ( ) ) ;
1199
+ }
1185
1200
} ;
1186
1201
1187
1202
@@ -1500,10 +1515,13 @@ MdPanelRef.prototype._done = function(callback, self) {
1500
1515
* position: panelPosition
1501
1516
* });
1502
1517
*
1503
- * @param @const {!angular.$window}
1518
+ * @param {!angular.$window } $window
1504
1519
* @final @constructor
1505
1520
*/
1506
1521
function MdPanelPosition ( $window ) {
1522
+ /** @private @const */
1523
+ this . _$window = $window ;
1524
+
1507
1525
/** @private {boolean} */
1508
1526
this . _absolute = false ;
1509
1527
@@ -1531,8 +1549,6 @@ function MdPanelPosition($window) {
1531
1549
/** @private {!Array<{x:string, y:string}> } */
1532
1550
this . _positions = [ ] ;
1533
1551
1534
- this . _$window = $window ;
1535
-
1536
1552
/** @private {?{x:string, y:string}} */
1537
1553
this . _actualPosition ;
1538
1554
}
0 commit comments