1

when you click "MAGIC" then a bootstrap popover is shown and there you see the settings icon. If you click that icon a modal window should open, like if you click on the blue button "Launch demo modal". How can I fix that? What is the problem?

Here my code: https://jsfiddle.net/vhsqf65z/

<span data-html='true' data-toggle='popover'
    title='<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal"><i class="glyphicon glyphicon-cog"></i></button>'
    data-content='<b>content</b>'> MAGIC </span>

<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
    <div class="modal-content">
        <div class="modal-header">
            <h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
        </div>
        <div class="modal-body">
            ...
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-secondary" data- 
dismiss="modal">Close</button>
            <button type="button" class="btn btn-primary">Save changes</button>
        </div>
    </div>
</div>

Thanks

Edit: Added an image showing the popover and settings button. enter image description here

Oliver
  • 79
  • 6

1 Answers1

2

I modified your code, removed handling inserted.bs.popover event:

https://jsfiddle.net/05nzfcak/

I tested it works (if I understood correctly what you want)

Dalibor
  • 1,430
  • 18
  • 42
  • 1
    Hi Dalibor, thank you for your help. It works now. Ok, so it was the popover click function. I need to rewrite this function anyway, because it's not always working as expected. Thank you very much. – Oliver May 26 '20 at 23:34