Skip to content

Commit

Permalink
Expose card env to ember component cards
Browse files Browse the repository at this point in the history
My understanding of mobiledoc-kit's Card API is that `env` is part of the public API that a card receives from mobiledoc. If so, then it should be accessible to ember component cards.

An example of a property accessible to cards that wasn't accessible to ember component cards is `env.isInEditor`.
  • Loading branch information
ef4 committed Mar 22, 2016
1 parent b8fcb1a commit 44a6cd8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion addon/components/mobiledoc-editor/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default Component.extend({
destinationElementId,
cardName,
payload,
callbacks: env,
env,
editor,
postModel: env.postModel
});
Expand Down
9 changes: 5 additions & 4 deletions addon/components/mobiledoc-editor/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
cardName=card.cardName
payload=card.payload
data=card.payload
editCard=(action card.callbacks.edit)
saveCard=(action card.callbacks.save)
cancelCard=(action card.callbacks.cancel)
removeCard=(action card.callbacks.remove)}}
env=card.env
editCard=(action card.env.edit)
saveCard=(action card.env.save)
cancelCard=(action card.env.cancel)
removeCard=(action card.env.remove)}}
{{/ember-wormhole}}
{{/each}}

0 comments on commit 44a6cd8

Please sign in to comment.