File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ export default {
35
35
data () {
36
36
return {
37
37
animateBackdrop: false ,
38
- animateModal: false
38
+ animateModal: false ,
39
+ visible: false
39
40
};
40
41
},
41
42
props: {
@@ -58,6 +59,7 @@ export default {
58
59
},
59
60
methods: {
60
61
show () {
62
+ this .visible = true ;
61
63
this .$el .style .display = ' block' ;
62
64
this ._body = document .querySelector (' body' );
63
65
const _this = this ;
@@ -72,6 +74,7 @@ export default {
72
74
}, 0 );
73
75
},
74
76
hide () {
77
+ this .visible = false ;
75
78
const _this = this ;
76
79
// first animate modal out
77
80
this .animateModal = false ;
@@ -93,6 +96,11 @@ export default {
93
96
}
94
97
},
95
98
pressedButton (e ) {
99
+ if ( ! this .visible ) {
100
+ // if not visible don't do anything
101
+ return ;
102
+ }
103
+
96
104
// support for esc key press
97
105
const key = e .which || e .keyCode ;
98
106
if (key === 27 ) { // 27 is esc
You can’t perform that action at this time.
0 commit comments