aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2015-08-26 01:11:03 -0700
committerChris Rebert <[email protected]>2015-08-26 01:11:03 -0700
commit3de3dac0b0389384f26d3dff96670c2926ca22dc (patch)
treef3ef66888159843516fd40eba9ec875460eebd4f
parent6d42a23039be9c2c440a8ada5c809d3f186d356a (diff)
parent54c4eb950b787e395f9532b5c4ad254724798d7b (diff)
downloadbootstrap-3de3dac0b0389384f26d3dff96670c2926ca22dc.tar.xz
bootstrap-3de3dac0b0389384f26d3dff96670c2926ca22dc.zip
Merge pull request #17330 from twbs/vejersele-bugfix/innerText
Rebased & tweaked version of #17272
-rw-r--r--js/src/popover.js10
-rw-r--r--js/src/tooltip.js4
2 files changed, 7 insertions, 7 deletions
diff --git a/js/src/popover.js b/js/src/popover.js
index 30c0e4acb..99e48e64f 100644
--- a/js/src/popover.js
+++ b/js/src/popover.js
@@ -116,12 +116,12 @@ const Popover = (($) => {
let tip = this.getTipElement()
let title = this.getTitle()
let content = this._getContent()
- let titleElement = $(tip).find(Selector.TITLE)[0]
+ let $titleElement = $(tip).find(Selector.TITLE)
- if (titleElement) {
- titleElement[
- this.config.html ? 'innerHTML' : 'innerText'
- ] = title
+ if ($titleElement) {
+ $titleElement[
+ this.config.html ? 'html' : 'text'
+ ](title)
}
// we use append for html objects to maintain js events
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index a65caf26e..aa5c73945 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -358,9 +358,9 @@ const Tooltip = (($) => {
setContent() {
let tip = this.getTipElement()
let title = this.getTitle()
- let method = this.config.html ? 'innerHTML' : 'innerText'
+ let method = this.config.html ? 'html' : 'text'
- $(tip).find(Selector.TOOLTIP_INNER)[0][method] = title
+ $(tip).find(Selector.TOOLTIP_INNER)[method](title)
$(tip)
.removeClass(ClassName.FADE)