mirror of
https://github.com/wassname/talk.git
synced 2026-07-23 13:10:20 +08:00
15 lines
331 B
JavaScript
15 lines
331 B
JavaScript
import { selectionIsInside } from './dom';
|
|
|
|
export default class API {
|
|
constructor(contentEditable, onChange) {
|
|
this.contentEditable = contentEditable;
|
|
this.broadcastChange = onChange;
|
|
}
|
|
isSelectionInside() {
|
|
return selectionIsInside(this.contentEditable);
|
|
}
|
|
focus() {
|
|
this.contentEditable.focus();
|
|
}
|
|
}
|