@@ -12,6 +12,9 @@ angular.module('ionic.service.modal', ['ionic.service.templateLoad', 'ionic.serv
12
12
var self = this ;
13
13
var element = angular . element ( this . el ) ;
14
14
15
+ document . body . classList . add ( 'disable-pointer-events' ) ;
16
+ this . el . classList . add ( 'enable-pointer-events' ) ;
17
+
15
18
self . _isShown = true ;
16
19
17
20
if ( ! element . parent ( ) . length ) {
@@ -46,7 +49,9 @@ angular.module('ionic.service.modal', ['ionic.service.templateLoad', 'ionic.serv
46
49
hide : function ( ) {
47
50
this . _isShown = false ;
48
51
var element = angular . element ( this . el ) ;
49
- $animate . removeClass ( element , this . animation ) ;
52
+ $animate . removeClass ( element , this . animation , function ( ) {
53
+ onHideModal ( element [ 0 ] ) ;
54
+ } ) ;
50
55
51
56
ionic . views . Modal . prototype . hide . call ( this ) ;
52
57
@@ -59,6 +64,7 @@ angular.module('ionic.service.modal', ['ionic.service.templateLoad', 'ionic.serv
59
64
element = angular . element ( this . el ) ;
60
65
this . _isShown = false ;
61
66
$animate . leave ( angular . element ( this . el ) , function ( ) {
67
+ onHideModal ( element [ 0 ] ) ;
62
68
self . scope . $parent . $broadcast ( 'modal.removed' , self ) ;
63
69
self . scope . $destroy ( ) ;
64
70
} ) ;
@@ -69,6 +75,11 @@ angular.module('ionic.service.modal', ['ionic.service.templateLoad', 'ionic.serv
69
75
}
70
76
} ) ;
71
77
78
+ function onHideModal ( element ) {
79
+ document . body . classList . remove ( 'disable-pointer-events' ) ;
80
+ element . classList . remove ( 'enable-pointer-events' ) ;
81
+ }
82
+
72
83
var createModal = function ( templateString , options ) {
73
84
// Create a new scope for the modal
74
85
var scope = options . scope && options . scope . $new ( ) || $rootScope . $new ( true ) ;
0 commit comments