Merge pull request #54 from google/tooltip-for-target
Check for existence of `for` target in MaterialTooltipmaster
commit
814e0ca23e
|
@ -72,12 +72,17 @@ MaterialTooltip.prototype.init = function() {
|
|||
|
||||
if (this.element_) {
|
||||
var forElId = this.element_.getAttribute('for');
|
||||
var forEl = document.getElementById(forElId);
|
||||
forEl = null;
|
||||
if (forElId) {
|
||||
forEl = document.getElementById(forElId);
|
||||
}
|
||||
|
||||
if (forEl) {
|
||||
forEl.addEventListener('mouseenter', this.handleMouseEnter_.bind(this),
|
||||
false);
|
||||
forEl.addEventListener('mouseleave', this.handleMouseLeave_.bind(this));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue