From c1f4bce3b870a3406867f4ef07ab84facda9037c Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Thu, 28 Jul 2016 11:13:12 -0700 Subject: [PATCH] change hasUndo and hasRedo to hasUndos and hasRedos --- docs/reference/models/state.md | 12 ++++++------ lib/models/state.js | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/reference/models/state.md b/docs/reference/models/state.md index f158b47ee..5e059f750 100644 --- a/docs/reference/models/state.md +++ b/docs/reference/models/state.md @@ -22,8 +22,8 @@ For convenience, in addition to transforms, many of the [`Selection`](./selectio - [`fragment`](#fragment) - [`inlines`](#inlines) - [`texts`](#texts) - - [`hasUndo`](#hasundo) - - [`hasRedo`](#hasredo) + - [`hasUndos`](#hasundos) + - [`hasRedos`](#hasredos) - [Selection-like Properties](#selection-like-properties) - [`{edge}Key`](#edgekey) - [`{edge}Offset`](#edgeoffset) @@ -99,15 +99,15 @@ Get a list of the lowest-depth [`Inline`](./inline.md) nodes in the current sele Get a list of the [`Text`](./text.md) nodes in the current selection. -### `hasUndo` +### `hasUndos` `Boolean` -Whether there are undoable events. +Whether there are undoable snapshots to revert to in the history. -### `hasRedo` +### `hasRedos` `Boolean` -Whether there are redoable events. +Whether there are redoable snapshots to revert to in the history. ## Selection-like Properties diff --git a/lib/models/state.js b/lib/models/state.js index 4962cf2b2..ed8c67cec 100644 --- a/lib/models/state.js +++ b/lib/models/state.js @@ -61,20 +61,20 @@ class State extends new Record(DEFAULTS) { /** * Is there undoable events? * - * @return {Boolean} hasUndo + * @return {Boolean} hasUndos */ - get hasUndo() { + get hasUndos() { return this.history.undos.size > 0 } /** * Is there redoable events? * - * @return {Boolean} hasRedo + * @return {Boolean} hasRedos */ - get hasRedo() { + get hasRedos() { return this.history.redos.size > 0 }