UNPKG

substance

Version:

Substance is a JavaScript library for web-based content editing. It provides building blocks for realizing custom text editors and web-based publishing systems.

24 lines (20 loc) 429 B
import { Command } from '../../ui' export default class Redo extends Command { getCommandState(params) { let editorSession = params.editorSession return { disabled: !editorSession.canRedo(), active: false } } execute(params) { let editorSession = params.editorSession if (editorSession.canRedo()) { editorSession.redo() return true } else { return false } } }