Skip to content

Commit

Permalink
Update docs about cards
Browse files Browse the repository at this point in the history
  • Loading branch information
bantic committed Oct 19, 2015
1 parent 97c2bba commit 7afe10c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,14 @@ will be used:

The component will be provided with the following `attrs`:

* `data`, the data payload for this card
* `data`, the data payload for this card. *Note* the data is disconnected from the card's payload in the serialized mobiledoc. To update the mobiledoc payload, use the `saveCard` or `mutData` actions.
* `editCard`, an action for toggling this card into edit mode (this action is a no-op if the card is already in edit mode)
* `removeCard`, an action for removing this card
* `removeCard`, an action for removing this card (see the ["remove" content-kit card action](https://github.com/bustlelabs/content-kit-editor/blob/master/CARDS.md#available-hooks))
* `saveCard`, an action accepting new data for the card payload, then saving
that data and toggling this card into display mode
* `cancelCard`, an action toggling this card to display mode without saving (this action is a no-op if the card is already in display mode)
* `removeCard`, an action for removing this card
that data and toggling this card into display mode can optionally be passed an extra `false` argument to avoid toggling to display mode (see the ["save content-kit card action](https://github.com/bustlelabs/content-kit-editor/blob/master/CARDS.md#available-hooks))
* `cancelCard`, an action toggling this card to display mode without saving (this action is a no-op if the card is already in display mode) (see the ["cancel content-kit card action](https://github.com/bustlelabs/content-kit-editor/blob/master/CARDS.md#available-hooks))
* `cardName` the name of this card
* `editor` A reference to the content-kit-editor
* `editor` A reference to the [content-kit-editor](https://github.com/bustlelabs/content-kit-editor)
* `cardSection` A reference to this card's `cardSection` model in the editor's abstract tree. This may be necessary to do programmatic editing (such as moving the card via the `postEditor#moveSection` API that content-kit-editor provides)

### Developing ember-content-kit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ test('passes through spellcheck option', function(assert) {
);
});


test('it bolds the text and fires `on-change`', function(assert) {
assert.expect(2);
let text = 'Howdy';
Expand All @@ -120,7 +119,7 @@ test('it bolds the text and fires `on-change`', function(assert) {
);
});

test('it toggle the section type and fires `on-change`', function(assert) {
test('it toggles the section type and fires `on-change`', function(assert) {
assert.expect(6);

let onChangeCount = 0;
Expand Down Expand Up @@ -337,7 +336,7 @@ test('`addCard` passes `data`, breaks reference to original payload', function(a
this.$('button#mutate-payload').click();

assert.equal(passedPayload.foo, 'baz', 'mutates its payload');
assert.equal(payload.foo, 'bar', 'payload remains unchanged');
assert.equal(payload.foo, 'bar', 'originalpayload remains unchanged');
});

test('#activeSectionTagNames is correct', function(assert) {
Expand Down

0 comments on commit 7afe10c

Please sign in to comment.