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 system. It is developed to power our online editing platform [Substance](http://substance.io).
23 lines (20 loc) • 431 B
JavaScript
import Command from './Command'
export default
class Redo extends Command {
getCommandState (params) {
const editorSession = params.editorSession
return {
disabled: !editorSession.canRedo(),
active: false
}
}
execute (params) {
const editorSession = params.editorSession
if (editorSession.canRedo()) {
editorSession.redo()
return true
} else {
return false
}
}
}