aboutsummaryrefslogtreecommitdiff
path: root/docs/components
diff options
context:
space:
mode:
authorGleb Mazovetskiy <[email protected]>2015-08-31 00:57:16 +0100
committerGleb Mazovetskiy <[email protected]>2015-08-31 01:06:13 +0100
commitc7d8e7a0777da91df2359655a7132e2b55482c0a (patch)
treec953ef46e464dd1556c3b11fab8b10b300bc8b29 /docs/components
parent8941bdfbda237bed621935cac439520eddc79150 (diff)
downloadbootstrap-c7d8e7a0777da91df2359655a7132e2b55482c0a.tar.xz
bootstrap-c7d8e7a0777da91df2359655a7132e2b55482c0a.zip
Accept elements as the tooltip / popover content
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 https://github.com/twbs/bootstrap/pull/14552 to v4.
Diffstat (limited to 'docs/components')
-rw-r--r--docs/components/popovers.md4
-rw-r--r--docs/components/tooltips.md2
2 files changed, 3 insertions, 3 deletions
diff --git a/docs/components/popovers.md b/docs/components/popovers.md
index 98672d23e..f48d860ea 100644
--- a/docs/components/popovers.md
+++ b/docs/components/popovers.md
@@ -193,7 +193,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
</tr>
<tr>
<td>content</td>
- <td>string | function</td>
+ <td>string | element | function</td>
<td>''</td>
<td>
<p>Default content value if <code>data-content</code> attribute isn't present.</p>
@@ -245,7 +245,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
</tr>
<tr>
<td>title</td>
- <td>string | function</td>
+ <td>string | element | function</td>
<td>''</td>
<td>
<p>Default title value if <code>title</code> attribute isn't present.</p>
diff --git a/docs/components/tooltips.md b/docs/components/tooltips.md
index 65bd2703b..f2936469b 100644
--- a/docs/components/tooltips.md
+++ b/docs/components/tooltips.md
@@ -203,7 +203,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
</tr>
<tr>
<td>title</td>
- <td>string | function</td>
+ <td>string | element | function</td>
<td>''</td>
<td>
<p>Default title value if <code>title</code> attribute isn't present.</p>