Last active
August 23, 2018 23:45
-
-
Save MaximBalaganskiy/eb33096dcf98a386bf3c77172d6cc061 to your computer and use it in GitHub Desktop.
Collapsible open demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | |
| </head> | |
| <body> | |
| <div aurelia-app="src/configure"> | |
| Loading... | |
| </div> | |
| <script src="https://rawgit.com/aurelia-ui-toolkits/demo-materialize/gh-pages/jspm_packages/system.js"></script> | |
| <script src="https://rawgit.com/aurelia-ui-toolkits/demo-materialize/gh-pages/jspm.config.js"></script> | |
| <script> | |
| System.import("aurelia-bootstrapper"); | |
| </script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div class="collapsible-basic-use"> | |
| <ul md-collapsible md-collapsible.ref="collapsible"> | |
| <li> | |
| <div class="collapsible-header"><i class="mdi-image-filter-drama"></i>First</div> | |
| <div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div> | |
| </li> | |
| <li> | |
| <div class="collapsible-header"><i class="mdi-maps-place"></i>Second</div> | |
| <div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div> | |
| </li> | |
| </ul> | |
| <button md-button click.delegate="openFirst()">Open First</button> | |
| <button md-button click.delegate="openSecond()">Open Second</button> | |
| </div> | |
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { MdCollapsible } from "aurelia-materialize-bridge"; | |
| import {inject, TaskQueue} from "aurelia-framework"; | |
| @inject(TaskQueue) | |
| export class App { | |
| collapsible: MdCollapsible; | |
| constructor(private taskQueue: TaskQueue){} | |
| attached(){ | |
| this.taskQueue.queueTask(()=>this.collapsible.open()); | |
| } | |
| openFirst() { | |
| this.collapsible.open(); | |
| } | |
| openSecond() { | |
| this.collapsible.open(1); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export async function configure(aurelia) { | |
| await aurelia.loader.loadModule("materialize-css"); | |
| aurelia.use | |
| .standardConfiguration() | |
| .developmentLogging() | |
| .plugin("aurelia-materialize-bridge", bridge => bridge.useAll()) | |
| .plugin("aurelia-validation") | |
| .globalResources("src/shared/logger"); | |
| await aurelia.start(); | |
| aurelia.setRoot("src/app"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment