Show uib-tooltip on mouseenter only if a condition is met?

那年仲夏 提交于 2019-12-23 05:07:06

问题


I'm new to angular and struggling with this. I have several heading elements with a truncate class applied to them so that they will truncate if their content is longer than one line. I want to show a uib-tooltip with the full content of the heading on mouseenter, but I don't want the tooltip to show if the content has not been truncated. The condition is the easy part, using scrollWidth and offsetWidth. I have that part working.

I have tried dynamically applying the uib-tooltip attribute on mouseenter if the content is truncated, but this doesn't seem to work. I have also tried using the tooltip-enable attribute to no avail.

I am now wondering if I'm going about this all wrong, and if there is a much simpler way to achieve this.

来源:https://stackoverflow.com/questions/44297971/show-uib-tooltip-on-mouseenter-only-if-a-condition-is-met

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!