aboutsummaryrefslogtreecommitdiff
path: root/js/src/popover.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/popover.js')
-rw-r--r--js/src/popover.js21
1 files changed, 5 insertions, 16 deletions
diff --git a/js/src/popover.js b/js/src/popover.js
index 30c0e4acb..b8b24a1c4 100644
--- a/js/src/popover.js
+++ b/js/src/popover.js
@@ -34,7 +34,7 @@ const Popover = (($) => {
})
const DefaultType = $.extend({}, Tooltip.DefaultType, {
- content : '(string|function)'
+ content : '(string|element|function)'
})
const ClassName = {
@@ -113,24 +113,13 @@ const Popover = (($) => {
}
setContent() {
- let tip = this.getTipElement()
- let title = this.getTitle()
- let content = this._getContent()
- let titleElement = $(tip).find(Selector.TITLE)[0]
-
- if (titleElement) {
- titleElement[
- this.config.html ? 'innerHTML' : 'innerText'
- ] = title
- }
+ let $tip = $(this.getTipElement())
// we use append for html objects to maintain js events
- $(tip).find(Selector.CONTENT).children().detach().end()[
- this.config.html ?
- (typeof content === 'string' ? 'html' : 'append') : 'text'
- ](content)
+ this.setElementContent($tip.find(Selector.TITLE), this.getTitle())
+ this.setElementContent($tip.find(Selector.CONTENT), this._getContent())
- $(tip)
+ $tip
.removeClass(ClassName.FADE)
.removeClass(ClassName.IN)