Skip to content

Instantly share code, notes, and snippets.

View Thanood's full-sized avatar

Daniel Bendel Thanood

  • Cologne, Germany
View GitHub Profile
@Thanood
Thanood / app.html
Created January 1, 2017 18:10
Aurelia combine bindable with collectionObserver
<template>
<require from="./my-component"></require>
<require from="./jsonValueConverter"></require>
<h1>Please observe console log</h1>
<my-component items.bind="items"></my-component>
<div>
items:
<ul>
@Thanood
Thanood / app.html
Last active December 22, 2016 21:27
Aurelia-Materialize bridge file input disable
<template>
<md-file disabled.bind="true" md-caption="upload file" view-model.ref="fileInput" md-label-value.bind="labelValue"></md-file>
<div if.bind="selectedFile">
selected file: ${selectedFile.name} (${selectedFile.size} bytes)
</div>
</template>
@Thanood
Thanood / app.html
Last active December 22, 2016 21:20
Aurelia-Materialize bridge dropdown repeat
<template>
<div class="dropdown-sample">
<table>
<tr repeat.for="n of 5">
<td>line ${n+1}</td>
<td>
<a md-button md-dropdown="ref.bind: dropdown;">drop me!</a>
<ul ref="dropdown">
<li><a click.trigger="showToast($event)">one</a></li>
<li><a click.trigger="showToast($event)">two</a></li>
@Thanood
Thanood / app.html
Last active December 22, 2016 20:38
Aurelia-Materialize bridge sidenav controller
<template>
<a disabled md-sidenav-collapse="ref.bind: sideNav;" md-sidenav-collapse.ref="sidenavController" md-button="flat: true;" md-waves>
Standard SideNav Toggle
</a>
<div>
<button md-button click.delegate="openSideNav()">open sidenav</button>
</div>
<md-sidenav view-model.ref="sideNav">
<ul>
<li md-waves><a href="#">About</a></li>
@Thanood
Thanood / app.html
Last active December 22, 2016 14:01
Aurelia-Materialize bridge modal external view
<template>
<require from="./error-dialog"></require>
<error-dialog view-model.ref="errorDialog"></error-dialog>
<div>
<button md-button click.delegate="openDialog()">open dialog</button>
</div>
</template>
@Thanood
Thanood / app.html
Created December 21, 2016 14:43
Aurelia-Materialize bridge sidenav automation
<template>
<a md-sidenav-collapse="ref.bind: sideNav;" md-button md-waves ref="trigger">Toggle SideNav</a>
<md-sidenav view-model.ref="sideNav">
<ul>
<li md-waves><a href="#">About</a></li>
<li md-waves><a href="#">Installation</a></li>
<li md-waves><a href="#">Project Status</a></li>
<li md-waves><a href="#">Help/Docs</a></li>
</ul>
</md-sidenav>
@Thanood
Thanood / _docs.md
Created December 20, 2016 20:13
Aurelia-Materialize bridge tabs height issue

Indicator issue when using tabs with waves

Waves make the container position: relative; and because of that the position of the child (a in the tab li) cannot be calculated correctly, it's always at left: 0.

To work around this, set this in a css file (like in app.css here):

[md-tabs] .waves-effect {
  position: static;
}
@Thanood
Thanood / app.css
Last active December 22, 2016 22:02
Aurelia-Materialize bridge tabs dynamic
[md-tabs] .waves-effect {
position: static;
}
@Thanood
Thanood / app.css
Created December 19, 2016 14:08
Aurelia-Materialize bridge datepicker validation + icon
/* add this css to prevent the icon from appearing below the datepicker input */
.date-picker + i.material-icons {
margin-left: -24px;
line-height: 1;
margin-top: 12px;
cursor: pointer;
}
@Thanood
Thanood / MaterializeFormValidationRenderer.js
Last active December 16, 2016 13:36
Aurelia-Materialize bridge input fields aurelia-validation ordinary text field
export class MaterializeFormValidationRenderer {
className = 'md-input-validation';
classNameFirst = 'md-input-validation-first';
render(instruction) {
for (let { result, elements } of instruction.unrender) {
for (let element of elements) {
this.remove(element, result);
}