mirror of
https://github.com/codex-team/editor.js
synced 2026-03-15 23:25:47 +01:00
Rename onClick to onActivate
This commit is contained in:
parent
0f55a45f6e
commit
9513665e50
4 changed files with 8 additions and 8 deletions
|
|
@ -53,7 +53,7 @@ export default class DeleteTune implements BlockTune {
|
|||
confirmation: {
|
||||
icon: $.svg('cross', 14, 14).outerHTML,
|
||||
label: 'Click to delete',
|
||||
onClick: (item, e): void => this.handleClick(e),
|
||||
onActivate: (item, e): void => this.handleClick(e),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ export default class MoveDownTune implements BlockTune {
|
|||
return {
|
||||
icon: $.svg('arrow-down', 14, 14).outerHTML,
|
||||
label: this.api.i18n.t('Move down'),
|
||||
onClick: (item, event): void => this.handleClick(event),
|
||||
onActivate: (item, event): void => this.handleClick(event),
|
||||
name: 'move-down',
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ export default class MoveUpTune implements BlockTune {
|
|||
return {
|
||||
icon: $.svg('arrow-up', 14, 14).outerHTML,
|
||||
label: this.api.i18n.t('Move up'),
|
||||
onClick: (item, e): void => this.handleClick(e),
|
||||
onActivate: (item, e): void => this.handleClick(e),
|
||||
name: 'move-up',
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ interface PopoverItemWithConfirmation extends PopoverItemBase {
|
|||
*/
|
||||
confirmation: PopoverItem;
|
||||
|
||||
onClick?: never;
|
||||
onActivate?: never;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -62,11 +62,11 @@ interface PopoverItemWithoutConfirmation extends PopoverItemBase {
|
|||
confirmation?: never;
|
||||
|
||||
/**
|
||||
* Item click handler
|
||||
* Item activation handler
|
||||
*
|
||||
* @param item - clicked item
|
||||
* @param item - activated item
|
||||
*/
|
||||
onClick: (item: PopoverItem, event?: MouseEvent) => void;
|
||||
onActivate: (item: PopoverItem, event?: MouseEvent) => void;
|
||||
}
|
||||
|
||||
export type PopoverItem = PopoverItemWithConfirmation | PopoverItemWithoutConfirmation
|
||||
|
|
@ -519,7 +519,7 @@ export default class Popover extends EventsDispatcher<PopoverEvent> {
|
|||
return;
|
||||
}
|
||||
|
||||
clickedItem.onClick(clickedItem, event);
|
||||
clickedItem.onActivate(clickedItem, event);
|
||||
|
||||
if (clickedItem.closeOnActivate) {
|
||||
this.hide();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue