mirror of
https://github.com/codex-team/editor.js
synced 2024-06-10 09:52:36 +02:00
Support hint
This commit is contained in:
parent
005e17058e
commit
3ed7f7e85a
|
@ -0,0 +1,6 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
export class HintContent {
|
||||
|
||||
}
|
|
@ -6,6 +6,7 @@ import {
|
|||
} from '../popover-item.types';
|
||||
import { PopoverItem } from '../popover-item';
|
||||
import { css } from './popover-item-default.const';
|
||||
import * as tooltip from '../../../../../utils/tooltip';
|
||||
|
||||
/**
|
||||
* Represents sigle popover item node
|
||||
|
@ -197,6 +198,13 @@ export class PopoverItemDefault extends PopoverItem {
|
|||
el.classList.add(css.disabled);
|
||||
}
|
||||
|
||||
if (params.hint !== undefined) {
|
||||
tooltip.onHover(el, params.hint.title, {
|
||||
placement: 'right',
|
||||
hidingDelay: 100,
|
||||
});
|
||||
}
|
||||
|
||||
return el;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,6 +89,11 @@ interface PopoverItemDefaultBaseParams {
|
|||
* In case of string, works like radio buttons group and highlights as inactive any other item that has same toggle key value.
|
||||
*/
|
||||
toggle?: boolean | string;
|
||||
|
||||
hint?: {
|
||||
title: string;
|
||||
description?: string;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue