Last active
December 25, 2015 12:29
-
-
Save brianpattison/6977160 to your computer and use it in GitHub Desktop.
Ember Tool Tip Component (Re: https://twitter.com/brianpattison/status/389631825347641344)
This file contains 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
App.ToolTipComponent = Ember.Component.extend({ | |
classNames: ['tool-tip-container'], | |
didInsertElement: function() { | |
var self = this; | |
Ember.run.schedule('afterRender', function() { | |
self.$('.tool-tip-hover-container').mouseenter(function() { | |
self.$('.tool-tip').addClass('active'); | |
}).mouseleave(function() { | |
self.$('.tool-tip').removeClass('active'); | |
}); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
seems like the
.tool-tip-hover-container
should be inserted by the time didInsertElement is called, this means the afterRender is unneeded.