1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-09-08 22:20:41 +02:00

more work on draggable nodes

This commit is contained in:
Ian Storm Taylor
2016-07-24 18:57:09 -07:00
parent 3bd000d118
commit 81c956228b
21 changed files with 215 additions and 65 deletions

View File

@@ -44,6 +44,7 @@ Transform methods can either operate on the [`Document`](./document.md), the [`S
- [`moveTo`](#moveto)
- [`move{Direction}`](#movedirection)
- [Node Transforms](#node-transforms)
- [`removeNodeByKey`](#removeNodeByKey)
- [`setNodeByKey`](#setNodeByKey)
- [Document Transforms](#document-transforms)
- [`deleteAtRange`](#deleteatrange)
@@ -233,11 +234,16 @@ Move the current selection to a selection with merged `properties`. The `propert
## Node Transforms
### `removeNodeByKey`
`removeNodeByKey(key: String) => Transform`
Remove a [`Node`](./node.md) from the document by its `key`.
### `setNodeByKey`
`setNodeByKey(key: String, properties: Object) => Transform`
`setNodeByKey(key: String, type: String) => Transform`
Set a dictionary of `properties` on the [`Node`](./node.md) with a `key`. For convenience, you can pass a `type` string or `properties` object.
Set a dictionary of `properties` on a [`Node`](./node.md) by its `key`. For convenience, you can pass a `type` string or `properties` object.
## Document Transforms