Skip to content

Commit

Permalink
chore(sample): add dismissible sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanood committed Apr 6, 2016
1 parent 8722d8f commit e633eb4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sample/src/samples/modals/options.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<template>
<div>
<div>
A modal which is not closable by clicking the overlay:
<p><a md-button md-modal-trigger="dismissible: false;" href="#modal1">show modal</a></p>
</div>
<div id="modal1" class="modal">
<div class="modal-content">
<h4>Modal Header</h4>
<p>A bunch of text</p>
</div>
<div class="modal-footer">
<a click.delegate="agree()" md-button="flat: true;" md-waves="color: accent;" class="modal-action modal-close">Agree</a>
<a click.delegate="disagree()" md-button="flat: true;" md-waves="color: accent;" class="modal-action modal-close">Disagree</a>
</div>
</div>
</div>
</template>
17 changes: 17 additions & 0 deletions sample/src/samples/modals/options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { inject } from 'aurelia-framework';
import { MdToastService } from 'aurelia-materialize-bridge/toast/toastService';

@inject(MdToastService)
export class Options {
constructor(toast) {
this.toast = toast;
}

agree(e) {
this.toast.show('You agreed!', 4000);
}

disagree(e) {
this.toast.show('You disagreed!', 4000);
}
}
4 changes: 4 additions & 0 deletions sample/src/samples/modals/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"events": {
"route": "events",
"files": ["html", "js"]
},
"options": {
"route": "options",
"files": ["html", "js"]
}
}
}

0 comments on commit e633eb4

Please sign in to comment.