Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need a way to make tooltips invisible. #59

Closed
taystack opened this issue Nov 27, 2013 · 3 comments
Closed

Need a way to make tooltips invisible. #59

taystack opened this issue Nov 27, 2013 · 3 comments

Comments

@taystack
Copy link

I have an appliaction where I have some disabled items at some points. There is no reason to show these tooltips since there is no action attached to the items they reference. Is it possible to attach a class to the tooltip to make it invisible?
eg;

into

Since "display: none" removes the entire container I am implementing a hack to alter your library's behavior. Ideally I would like to leave your implementation alone.

@chinchang
Copy link
Owner

Because you talked about attaching classes, I suppose you are using jQuery or something already. In that there is another hack you can use to disable hint on a disabled element without altering the library:

Tooltips are shown on any element with data-hint attribute. Instead of adding a class to disable hint, what you can do is remove the data-hint attribute and put its value on, say data-hint-disabled (anything but data-hint) attribute. This will make the tooltip not show. When item gets enabled, switch back the right attribute.

@taystack
Copy link
Author

Fair enough. I just added a disabled class for anyone interested;
scss:

.#{$prefix}disabled {
  &:after, &:before {
    visibility: hidden;
  }
}

haml:

.thing.hint--right.hint--disabled{data-hint: "Cool"}
  .thing{disabled: true}

I had to do some jquery parent-selector magic to alter the parent class of the disabled element, but it works seamlessly for what I need since the disabled element is enabled dynamically. Thanks for the quick reply and I hope someone else finds this useful.

@chinchang
Copy link
Owner

cool 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants