-
-
Notifications
You must be signed in to change notification settings - Fork 311
Add warning if sanitize is set to false for tooltips and popovers #444
Add warning if sanitize is set to false for tooltips and popovers #444
Conversation
Signed-off-by: mhatvan <markus_hatvan@aon.at>
@Johann-S aww, too bad, I must have overread this note in the options when I was reading the documentation. |
you should select all the tooltips and popovers by doing that: |
@Johann-S Can't get it working according to your explanation.
In a bootstrap project in the browser I can do When running |
if you have multiple tooltip triggers this jQuery cal $.each($('[data-toggle="tooltip"]'), function ($tooltip) {
$tooltip.data('bs.tooltip') // => return a Tooltip instance
}) |
Tried again, can't get it to work, maybe someone else wants to take over this PR. |
Hi @mhatvan, You should try that: $('[data-toggle="tooltip"], [data-toggle="popover"]').each(function () {
var dataKey = $(this).attr('data-toggle') === 'tooltip' ? 'bs.tooltip' : 'bs.popover'
var obj = $(this).data(dataKey)
if (!obj.config.sanitize) {
// warn here
}
}) Do not hesitate to tell me where you're stuck 😉 |
Your code snippet looks solid, but doesn't work either -> |
Oh yes you're right @mhatvan, I updated my code, it should be fine now 😄 |
I receive the correct value for
So how to initialize the popover correctly? Also, since it is in an |
It's not your job to initialize the popover/tooltip, you have to check if an initialized Popover/Tooltip disabled the sanitize option.
Yup it's seems correct to me 🤔 maybe @Herst have some feedbacks |
There should be only a single call to |
I tried again getting this to work, in the browser it works fine, in
|
Hi @mhatvan if you're unable to retrieve something from |
Well, that's what I receive for all tooltips and popovers, so I can't access any options and can't implement the reporter to report on anything. |
So you have to initialized some of them before running your tests to simulate a real use case 😉 |
Closes #434.