|
1 | 1 | /* ======================================================================== |
2 | | - * Bootstrap: popover.js v3.4.0 |
| 2 | + * Bootstrap: popover.js v3.4.1 |
3 | 3 | * https://getbootstrap.com/docs/3.4/javascript/#popovers |
4 | 4 | * ======================================================================== |
5 | | - * Copyright 2011-2018 Twitter, Inc. |
| 5 | + * Copyright 2011-2019 Twitter, Inc. |
6 | 6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
7 | 7 | * ======================================================================== */ |
8 | 8 |
|
|
19 | 19 |
|
20 | 20 | if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') |
21 | 21 |
|
22 | | - Popover.VERSION = '3.4.0' |
| 22 | + Popover.VERSION = '3.4.1' |
23 | 23 |
|
24 | 24 | Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { |
25 | 25 | placement: 'right', |
|
45 | 45 | var title = this.getTitle() |
46 | 46 | var content = this.getContent() |
47 | 47 |
|
48 | | - $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) |
49 | | - $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events |
50 | | - this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' |
51 | | - ](content) |
| 48 | + if (this.options.html) { |
| 49 | + var typeContent = typeof content |
| 50 | + |
| 51 | + if (this.options.sanitize) { |
| 52 | + title = this.sanitizeHtml(title) |
| 53 | + |
| 54 | + if (typeContent === 'string') { |
| 55 | + content = this.sanitizeHtml(content) |
| 56 | + } |
| 57 | + } |
| 58 | + |
| 59 | + $tip.find('.popover-title').html(title) |
| 60 | + $tip.find('.popover-content').children().detach().end()[ |
| 61 | + typeContent === 'string' ? 'html' : 'append' |
| 62 | + ](content) |
| 63 | + } else { |
| 64 | + $tip.find('.popover-title').text(title) |
| 65 | + $tip.find('.popover-content').children().detach().end().text(content) |
| 66 | + } |
52 | 67 |
|
53 | 68 | $tip.removeClass('fade top bottom left right in') |
54 | 69 |
|
|
0 commit comments