File tree Expand file tree Collapse file tree 2 files changed +34
-21
lines changed Expand file tree Collapse file tree 2 files changed +34
-21
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ const Tooltip = (($) => {
273
273
const attachment = this . _getAttachment ( placement )
274
274
this . addAttachmentClass ( attachment )
275
275
276
- const container = this . config . container === false ? document . body : $ ( this . config . container )
276
+ const container = this . config . container === false ? document . body : $ ( document ) . find ( this . config . container )
277
277
278
278
$ ( tip ) . data ( this . constructor . DATA_KEY , this )
279
279
Original file line number Diff line number Diff line change @@ -27,27 +27,40 @@ <h1>Tooltip <small>Bootstrap Visual Test</small></h1>
27
27
28
28
< hr >
29
29
30
- < p >
31
- < button type ="button " class ="btn btn-secondary " data-toggle ="tooltip " data-placement ="auto " title ="Tooltip on auto ">
32
- Tooltip on auto
33
- </ button >
34
- < button type ="button " class ="btn btn-secondary " data-toggle ="tooltip " data-placement ="top " title ="Tooltip on top ">
35
- Tooltip on top
36
- </ button >
37
- < button type ="button " class ="btn btn-secondary " data-toggle ="tooltip " data-placement ="right " title ="Tooltip on right ">
38
- Tooltip on right
39
- </ button >
40
- < button type ="button " class ="btn btn-secondary " data-toggle ="tooltip " data-placement ="bottom " title ="Tooltip on bottom ">
41
- Tooltip on bottom
42
- </ button >
43
- < button type ="button " class ="btn btn-secondary " data-toggle ="tooltip " data-placement ="left " title ="Tooltip on left ">
44
- Tooltip on left
45
- </ button >
46
- < button type ="button " class ="btn btn-secondary " data-toggle ="tooltip " data-html ="true " title ="<em>Tooltip</em> <u>with</u> <b>HTML</b> ">
47
- Tooltip with HTML
48
- </ button >
49
- </ p >
30
+ < div class ="row ">
31
+ < p >
32
+ < button type ="button " class ="btn btn-secondary " data-toggle ="tooltip " data-placement ="auto " title ="Tooltip on auto ">
33
+ Tooltip on auto
34
+ </ button >
35
+ < button type ="button " class ="btn btn-secondary " data-toggle ="tooltip " data-placement ="top " title ="Tooltip on top ">
36
+ Tooltip on top
37
+ </ button >
38
+ < button type ="button " class ="btn btn-secondary " data-toggle ="tooltip " data-placement ="right " title ="Tooltip on right ">
39
+ Tooltip on right
40
+ </ button >
41
+ < button type ="button " class ="btn btn-secondary " data-toggle ="tooltip " data-placement ="bottom " title ="Tooltip on bottom ">
42
+ Tooltip on bottom
43
+ </ button >
44
+ < button type ="button " class ="btn btn-secondary " data-toggle ="tooltip " data-placement ="left " title ="Tooltip on left ">
45
+ Tooltip on left
46
+ </ button >
47
+ </ p >
48
+ </ div >
49
+ < div class ="row ">
50
+ < p >
51
+ < button type ="button " class ="btn btn-secondary " data-toggle ="tooltip " data-placement ="left " title ="Tooltip with XSS " data-container ="<img src=1 onerror=alert(123) /> ">
52
+ Tooltip with XSS
53
+ </ button >
54
+ < button type ="button " class ="btn btn-secondary " data-toggle ="tooltip " data-placement ="left " title ="Tooltip with container " data-container ="#customContainer ">
55
+ Tooltip with container
56
+ </ button >
57
+ < button type ="button " class ="btn btn-secondary " data-toggle ="tooltip " data-html ="true " title ="<em>Tooltip</em> <u>with</u> <b>HTML</b> ">
58
+ Tooltip with HTML
59
+ </ button >
60
+ </ p >
61
+ </ div >
50
62
< div id ="target " title ="Test tooltip on transformed element "> </ div >
63
+ < div id ="customContainer "> </ div >
51
64
</ div >
52
65
53
66
< script src ="../../../assets/js/vendor/jquery-slim.min.js "> </ script >
You can’t perform that action at this time.
0 commit comments