This repository was archived by the owner on May 29, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ angular.module('ui.bootstrap.modal', [])
136136 modalWindow . modalDomEl . remove ( ) ;
137137
138138 //remove backdrop if no longer needed
139- if ( backdropIndex ( ) == - 1 ) {
139+ if ( backdropDomEl && backdropIndex ( ) == - 1 ) {
140140 backdropDomEl . remove ( ) ;
141141 backdropDomEl = undefined ;
142142 }
@@ -312,4 +312,4 @@ angular.module('ui.bootstrap.modal', [])
312312 } ;
313313
314314 return $modalProvider ;
315- } ) ;
315+ } ) ;
Original file line number Diff line number Diff line change @@ -351,12 +351,15 @@ describe('$modal', function () {
351351 describe ( 'backdrop' , function ( ) {
352352
353353 it ( 'should not have any backdrop element if backdrop set to false' , function ( ) {
354- open ( {
354+ var modal = open ( {
355355 template : '<div>No backdrop</div>' ,
356356 backdrop : false
357357 } ) ;
358358 expect ( $document ) . toHaveModalOpenWithContent ( 'No backdrop' , 'div' ) ;
359359 expect ( $document ) . not . toHaveBackdrop ( ) ;
360+
361+ dismiss ( modal ) ;
362+ expect ( $document ) . toHaveModalsOpen ( 0 ) ;
360363 } ) ;
361364
362365 it ( 'should not close modal on backdrop click if backdrop is specified as "static"' , function ( ) {
You can’t perform that action at this time.
0 commit comments