aurelia-materialize-bridge
Version:
Aurelia interface to http://materializecss.com/
34 lines (26 loc) • 676 B
text/typescript
import * as au from "../aurelia";
.customAttribute("md-pushpin")
.autoinject
export class MdPushpin {
constructor(private element: Element) { }
.ato.bindable.numberMd
bottom: number;
.ato.bindable.numberMd
offset: number;
.ato.bindable.numberMd
top: number;
instance: M.Pushpin;
attached() {
let options: Partial<M.PushpinOptions> = {
bottom: this.bottom,
offset: this.offset,
top: this.top,
onPositionChange: position => au.fireMaterializeEvent(this.element, "position-change", { position })
};
au.cleanOptions(options);
this.instance = new M.Pushpin(this.element, options);
}
detached() {
this.instance.destroy();
}
}