Closed lukehorvat closed 10 years ago
Hmmm, I also noticed something with the following line in bootstrap.js
:
$(".tooltip").tooltip()
Am I wrong in assuming that this is simply meant to initialise a Bootstrap tooltip for any element on the page with class .tooltip
? If so, I suggest renaming it to something else, like .has-tooltip
. Why? Because the .tooltip
CSS class is already used by Bootstrap and has certain style properties like opacity: 0
which effectively renders your elements invisible, so we should use naming that does not conflict with it.
Same deal for popovers as well.
In a Rails 3.2 app, if I do this:
It outputs this:
As can be seen, specifying a
data-method
results in a "nofollow" value being appended to therel
attribute, which already has the value "tooltip". This causes no Bootstrap tooltip to be created for the link element, because the jQuery selector inbootstrap.js
only checks whetherrel
is exactly equal to "tooltip", like so:So I think it would be better if we made it check whether the
rel
attribute merely contains the value "tooltip", using jQuery's attribute contains word selector. Example:Objections?