editor: add missing null checks
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/900/head
parent
f0c7cf7542
commit
3e40a3e5d2
|
@ -345,20 +345,20 @@ export default defineComponent({
|
|||
// ctrl + S = save
|
||||
if (event.ctrlKey && event.key === 's') {
|
||||
event.preventDefault();
|
||||
(document.querySelector('.FIE_topbar-save-button') as HTMLElement).click();
|
||||
(document.querySelector('.FIE_topbar-save-button') as HTMLElement)?.click();
|
||||
}
|
||||
|
||||
// ctrl + Z = undo
|
||||
if (event.ctrlKey && event.key === 'z') {
|
||||
event.preventDefault();
|
||||
(document.querySelector('.FIE_topbar-undo-button') as HTMLElement).click();
|
||||
(document.querySelector('.FIE_topbar-undo-button') as HTMLElement)?.click();
|
||||
}
|
||||
},
|
||||
|
||||
close() {
|
||||
// Since we cannot call the closeMethod and know if there
|
||||
// are unsaved changes, let's fake a close button trigger.
|
||||
(document.querySelector('.FIE_topbar-close-button') as HTMLElement).click();
|
||||
(document.querySelector('.FIE_topbar-close-button') as HTMLElement)?.click();
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue