File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,12 @@ export default {
142
142
document .addEventListener (Config .EVENT_OPEN , function () {
143
143
this .botOpen ()
144
144
})
145
+ document .addEventListener (Config .EVENT_CLOSE , function () {
146
+ this .botClose ()
147
+ })
148
+ document .addEventListener (Config .EVENT_TOGGLE , function () {
149
+ this .botToggle ()
150
+ })
145
151
},
146
152
147
153
beforeDestroy () {
@@ -155,6 +161,12 @@ export default {
155
161
}
156
162
},
157
163
164
+ botClose () {
165
+ if (this .botActive ) {
166
+ this .botToggle ()
167
+ }
168
+ },
169
+
158
170
botToggle () {
159
171
this .botActive = ! this .botActive
160
172
Original file line number Diff line number Diff line change 1
1
export default {
2
- EVENT_OPEN : 'botui-open'
2
+ EVENT_OPEN : 'botui-open' ,
3
+ EVENT_CLOSE : 'botui-close' ,
4
+ EVENT_TOGGLE : 'botui-toggle'
3
5
}
You can’t perform that action at this time.
0 commit comments