This repository was archived by the owner on May 29, 2019. It is now read-only.
File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -324,7 +324,10 @@ angular.module('ui.bootstrap.modal', [])
324
324
$modalStack . close = function ( modalInstance , result ) {
325
325
var modalWindow = openedWindows . get ( modalInstance ) ;
326
326
if ( modalWindow && broadcastClosing ( modalWindow , result , true ) ) {
327
- modalWindow . value . deferred . resolve ( result ) ;
327
+ // Defer resolution until after modal window is closed - #3787
328
+ $timeout ( function ( ) {
329
+ modalWindow . value . deferred . resolve ( result ) ;
330
+ } ) ;
328
331
removeModalWindow ( modalInstance , modalWindow . value . modalOpener ) ;
329
332
return true ;
330
333
}
@@ -334,7 +337,10 @@ angular.module('ui.bootstrap.modal', [])
334
337
$modalStack . dismiss = function ( modalInstance , reason ) {
335
338
var modalWindow = openedWindows . get ( modalInstance ) ;
336
339
if ( modalWindow && broadcastClosing ( modalWindow , reason , false ) ) {
337
- modalWindow . value . deferred . reject ( reason ) ;
340
+ // Defer rejection until after modal window is dismissed - #3787
341
+ $timeout ( function ( ) {
342
+ modalWindow . value . deferred . reject ( reason ) ;
343
+ } ) ;
338
344
removeModalWindow ( modalInstance , modalWindow . value . modalOpener ) ;
339
345
return true ;
340
346
}
You can’t perform that action at this time.
0 commit comments