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

Accept elements as the tooltip / popover content #17402

Merged
merged 1 commit into from
Aug 31, 2015
Merged

Accept elements as the tooltip / popover content #17402

merged 1 commit into from
Aug 31, 2015

Conversation

glebm
Copy link
Member

@glebm glebm commented Aug 31, 2015

When a DOM node is passed to an HTML tooltip, the node is only moved
if it is not already in the tooltip. If a DOM node is passed to a plain text
tooltip, its text is copied via jQuery .text().

Replaces .detach() with .empty(), as .detach() is almost never
useful but instead leaks memory. The difference between empty and
detach is that the latter keeps all the attached jQuery events/data.
However, since we do not return the previous children, the user would
have to keep these themselves, thus they can detach() if necessary.

This is a port of #14552 to v4.

When a DOM node is passed to an HTML tooltip, the `title` node is only
moved if it is not already in the tooltip. Otherwise, `empty()` is used
instead of `detach()` before appending the `title` to avoid memory
leaks. If a DOM node is passed to a plain text tooltip, its text is
copied via jQuery `.text()`.

Replaces `.detach()` with `.empty()`, as `.detach()` is almost never
useful but instead leaks memory. The difference between `empty` and
`detach` is that the latter keeps all the attached jQuery events/data.
However, since we do not return the previous children, the user would
have to keep these themselves, thus they can `detach()` if necessary.

This is a port of #14552 to v4.
@cvrebert
Copy link
Collaborator

👍

glebm added a commit that referenced this pull request Aug 31, 2015
Accept elements as the tooltip / popover content
@glebm glebm merged commit 33a510c into v4-dev Aug 31, 2015
@XhmikosR XhmikosR deleted the pr-14552-v4 branch September 5, 2015 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants