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

show tooltip if the cell content is taller than the cell height - fixes #740 #741

Merged
merged 2 commits into from
Apr 25, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions plugins/slick.autotooltips.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
if (options.maxToolTipLength && text.length > options.maxToolTipLength) {
text = text.substr(0, options.maxToolTipLength - 3) + "...";
}
} else {
} else if ($node.innerHeight() < $node[0].scrollHeight) {
Copy link
Collaborator

@ghiscoding ghiscoding Apr 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not merge this else if into the first if? I think this would be better and it would also include the line 56-58 which deals with longer text tooltip

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good suggestion! I've updated the code. Thanks!

text = $.trim($node.text());
} else {
text = "";
}
$node.attr("title", text);
Expand Down Expand Up @@ -86,4 +88,4 @@
"pluginName": "AutoTooltips"
});
}
})(jQuery);
})(jQuery);