mirror of
https://github.com/codex-team/editor.js
synced 2024-06-10 18:03:25 +02:00
4c0d806a12
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
35 lines
682 B
TypeScript
35 lines
682 B
TypeScript
import Module from '../../__module';
|
|
import { InlineToolbar } from '../../../../types/api/inline-toolbar';
|
|
|
|
/**
|
|
* @class InlineToolbarAPI
|
|
* Provides methods for working with the Inline Toolbar
|
|
*/
|
|
export default class InlineToolbarAPI extends Module {
|
|
/**
|
|
* Available methods
|
|
*
|
|
* @returns {InlineToolbar}
|
|
*/
|
|
public get methods(): InlineToolbar {
|
|
return {
|
|
close: (): void => this.close(),
|
|
open: (): void => this.open(),
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Open Inline Toolbar
|
|
*/
|
|
public open(): void {
|
|
this.Editor.InlineToolbar.tryToShow();
|
|
}
|
|
|
|
/**
|
|
* Close Inline Toolbar
|
|
*/
|
|
public close(): void {
|
|
this.Editor.InlineToolbar.close();
|
|
}
|
|
}
|