File tree 6 files changed +44
-22630
lines changed
6 files changed +44
-22630
lines changed Original file line number Diff line number Diff line change 15
15
</template >
16
16
17
17
<script >
18
- import { withFocusTrap } from ' @/common/focustrap' ;
19
-
20
- const el = vm => vm .$children [0 ].$refs .dialog ;
21
-
22
18
export default {
23
19
name: ' confirmation-dialog' ,
24
- mixins: [withFocusTrap ({ el })],
25
20
props: {
26
21
visible: { type: Boolean , default: false },
27
22
heading: { type: String , default: ' ' },
28
23
message: { type: String , default: ' Are you sure?' },
29
24
action: { type: Function , default : () => true }
30
25
},
26
+ data () {
27
+ return {
28
+ focusTrap: null
29
+ };
30
+ },
31
31
computed: {
32
32
show: {
33
33
get () {
@@ -48,11 +48,6 @@ export default {
48
48
this .$emit (' confirmed' );
49
49
});
50
50
}
51
- },
52
- watch: {
53
- show (val ) {
54
- this .$nextTick (() => this .focusTrap .toggle (val));
55
- }
56
51
}
57
52
};
58
53
</script >
Original file line number Diff line number Diff line change 75
75
<script >
76
76
import api from ' @/admin/api/user' ;
77
77
import saveAs from ' save-as' ;
78
- import { withFocusTrap } from ' @/common/focustrap' ;
79
-
80
- const el = vm => vm .$children [0 ].$refs .dialog ;
81
78
82
79
const inputFormats = {
83
80
' application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' : ' xlsx' ,
@@ -86,7 +83,6 @@ const inputFormats = {
86
83
87
84
export default {
88
85
name: ' import-dialog' ,
89
- mixins: [withFocusTrap ({ el })],
90
86
data : () => ({
91
87
showDialog: false ,
92
88
importing: false ,
@@ -113,8 +109,8 @@ export default {
113
109
},
114
110
close () {
115
111
if (this .importing ) return ;
112
+ if (this .$refs .fileInput ) this .$refs .fileInput .value = null ;
116
113
this .filename = null ;
117
- this .$refs .fileInput .value = null ;
118
114
this .resetErrors ();
119
115
this .showDialog = false ;
120
116
},
@@ -147,11 +143,6 @@ export default {
147
143
this .error = null ;
148
144
this .$refs .form ? .reset ();
149
145
}
150
- },
151
- watch: {
152
- showDialog (val ) {
153
- this .$nextTick (() => this .focusTrap .toggle (val));
154
- }
155
146
}
156
147
};
157
148
< / script>
Original file line number Diff line number Diff line change @@ -80,9 +80,6 @@ import humanize from 'humanize-string';
80
80
import isEmpty from ' lodash/isEmpty' ;
81
81
import map from ' lodash/map' ;
82
82
import { Role } from ' @/../common/config' ;
83
- import { withFocusTrap } from ' @/common/focustrap' ;
84
-
85
- const el = vm => vm .$children [0 ].$refs .dialog ;
86
83
87
84
const resetUser = () => {
88
85
return {
@@ -95,7 +92,6 @@ const resetUser = () => {
95
92
96
93
export default {
97
94
name: ' user-dialog' ,
98
- mixins: [withFocusTrap ({ el })],
99
95
props: {
100
96
visible: { type: Boolean , default: false },
101
97
userData: { type: Object , default : () => ({}) }
@@ -137,7 +133,6 @@ export default {
137
133
},
138
134
watch: {
139
135
show (val ) {
140
- this .$nextTick (() => this .focusTrap .toggle (val));
141
136
if (! val) return ;
142
137
this .$refs .form ? .reset ();
143
138
if (! isEmpty (this .userData )) this .user = cloneDeep (this .userData );
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments