Skip to content

Commit

Permalink
Merge pull request #4 from goldenLunchbox/patch-1
Browse files Browse the repository at this point in the history
add optional explanation text
  • Loading branch information
pogopaule committed Nov 13, 2015
2 parents df85f4a + 1cd412e commit dd7982e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ ember install:addon ember-confirm-extension
{{#confirm-extension questionText='Do you really want to destroy the planet?' confirmText='Yes' declineText='No' confirmAction='destroyEarth'}}
<button>Destroy Earth</button>
{{/confirm-extension}}
<!-- with optional explanation text -->
{{#confirm-extension questionText='Do you really want to destroy the planet?' explanationText="be careful you might get dirty" confirmText='Yes' declineText='No' confirmAction='destroyEarth'}}
<button>Destroy Earth</button>
{{/confirm-extension}}
```

## Styling
Expand Down
3 changes: 3 additions & 0 deletions addon/templates/components/confirm-extension.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
{{#if confirmMode}}
<div class="ece-bubble">
<div class="ece-question">{{questionText}}</div>
{{#if explanationText}}
<div class="ece-text">{{explanationText}}</div>
{{/if}}
<div class="ece-buttons">
<button class="ece-confirm" {{action 'confirm'}}>{{confirmText}}</button>
<button class="ece-decline" {{action 'decline'}}>{{declineText}}</button>
Expand Down
7 changes: 7 additions & 0 deletions tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@
{{/confirm-extension}} THIS IS <strong>DANGEROUS</strong>!
<p>I'm positive. This power should not be abused</p>
</div>

<h1>Simple Styles With Added Explanation Text</h1>
<div class="simple-styles">
{{#confirm-extension questionText='Do you really want to destroy our home planet?' confirmText='sure!' explanationText='ATTENTION! THIS IS DANGEROUS!' declineText='no' confirmAction='boom'}}
<button>Destroy planet earth</button>
{{/confirm-extension}}
</div>

0 comments on commit dd7982e

Please sign in to comment.