blob: c9df41b7062c64275c973a3036f9cb4123658e25 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
import {
type EditorView,
type Panel,
runScopeHandlers,
} from '@codemirror/view';
import type SearchPanelStore from './SearchPanelStore';
export default class SearchPanel implements Panel {
readonly dom: HTMLDivElement;
constructor(view: EditorView, store: SearchPanelStore) {
this.dom = document.createElement('div');
this.dom.id = store.id;
this.dom.className = store.panelClass;
this.dom.addEventListener(
'keydown',
(event) => {
if (runScopeHandlers(view, event, 'search-panel')) {
event.preventDefault();
}
},
{
capture: true,
},
);
}
get top(): boolean {
return true;
}
}
|