UNPKG

handsontable

Version:

Handsontable is a JavaScript Data Grid available for React, Angular and Vue.

24 lines (23 loc) 548 B
import * as C from "../../../i18n/constants.mjs"; export const KEY = 'undo'; /** * @returns {object} */ export default function undoItem() { return { key: KEY, name() { return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_UNDO); }, callback() { this.getPlugin('undoRedo').undo(); }, hidden() { const undoRedoPlugin = this.getPlugin('undoRedo'); return !undoRedoPlugin || !undoRedoPlugin.isEnabled(); }, disabled() { return !this.getPlugin('undoRedo').isUndoAvailable(); } }; }