Skip to content

Commit

Permalink
feat(md-tooltip): add html option, closes #228
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanood committed Aug 10, 2016
1 parent 9da8f1b commit ca965f3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/tooltip/tooltip.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
import { bindable, customAttribute } from 'aurelia-templating';
import { inject } from 'aurelia-dependency-injection';
import { AttributeManager } from '../common/attributeManager';
// import { getBooleanFromAttributeValue } from '../common/attributes';
import { getBooleanFromAttributeValue } from '../common/attributes';

@customAttribute('md-tooltip')
@inject(Element)
export class MdTooltip {
@bindable() position = 'bottom';
@bindable() delay = 50;
@bindable() html = false;
@bindable() text = '';
constructor(element) {
this.element = element;
this.attributeManager = new AttributeManager(this.element);
}
bind() {
this.html = getBooleanFromAttributeValue(this.html);
}
attached() {
this.attributeManager.addClasses('tooltipped');
this.attributeManager.addAttributes({ 'data-position': this.position, 'data-tooltip': this.text });
$(this.element).tooltip({ delay: parseInt(this.delay, 10) });
$(this.element).tooltip({
delay: parseInt(this.delay, 10),
html: this.html
});
}
detached() {
Expand Down

0 comments on commit ca965f3

Please sign in to comment.