@@ -1889,23 +1889,24 @@ MdPanelRef.prototype._configureClickOutsideToClose = function() {
1889
1889
* @private
1890
1890
*/
1891
1891
MdPanelRef . prototype . _configureScrollListener = function ( ) {
1892
- var updatePosition = angular . bind ( this , this . _updatePosition ) ;
1893
- var debouncedUpdatePosition = this . _$$rAF . throttle ( updatePosition ) ;
1894
- var self = this ;
1892
+ // No need to bind the event if scrolling is disabled.
1893
+ if ( ! this . config [ 'disableParentScroll' ] ) {
1894
+ var updatePosition = angular . bind ( this , this . _updatePosition ) ;
1895
+ var debouncedUpdatePosition = this . _$$rAF . throttle ( updatePosition ) ;
1896
+ var self = this ;
1895
1897
1896
- var onScroll = function ( ) {
1897
- if ( ! self . config [ 'disableParentScroll' ] ) {
1898
+ var onScroll = function ( ) {
1898
1899
debouncedUpdatePosition ( ) ;
1899
- }
1900
- } ;
1900
+ } ;
1901
1901
1902
- // Add listeners.
1903
- this . _$window . addEventListener ( 'scroll' , onScroll , true ) ;
1902
+ // Add listeners.
1903
+ this . _$window . addEventListener ( 'scroll' , onScroll , true ) ;
1904
1904
1905
- // Queue remove listeners function.
1906
- this . _removeListeners . push ( function ( ) {
1907
- self . _$window . removeEventListener ( 'scroll' , onScroll , true ) ;
1908
- } ) ;
1905
+ // Queue remove listeners function.
1906
+ this . _removeListeners . push ( function ( ) {
1907
+ self . _$window . removeEventListener ( 'scroll' , onScroll , true ) ;
1908
+ } ) ;
1909
+ }
1909
1910
} ;
1910
1911
1911
1912
0 commit comments