mistic100 / Bootstrap-Confirmation

Bootstrap plugin for on-place confirm boxes using Popover
http://bootstrap-confirmation.js.org
307 stars 124 forks source link

Confirmation and title #125

Closed solomax closed 4 years ago

solomax commented 4 years ago

Not sure if this is issue or I want too much :)

I have button with title attribute set

<button class="btn btn-primary" title="Delete user record" id="A">Delete</button>

I'm setting confirmation with custom title:

$('#A').confirmation({
  "btnCancelLabel":"Cancel"
  ,"btnOkLabel":"OK"
  ,"title":"Do you really want to delete this item?"
  ,"btnOkClass":"btn btn-sm btn-danger"
  ,"btnOkIconClass":"fas fa-exclamation-triangle"
  ,"rootSelector":"A"});

then displaying it:

$('#A').confirmation('show');

As a result I'm getting confirmation with title: Delete user record NOT Do you really want to delete this item?

Is it possible to have configured title for confirmation and unchanged title for button?

confirmation version 4.1.0

mistic100 commented 4 years ago

Hello

this is how BT Popover behaves, I have no intention to change it.

FYI this is the part of BT which removes the original title when Tooltip or Popover is applied to an element https://github.com/twbs/bootstrap/blob/master/js/src/tooltip.js#L584

mistic100 commented 4 years ago

On second though you could probably define your element with "title" AND "data-original-title" in order to keep the title and have a separated one of the confirmation.

But this is not documented by BT

solomax commented 4 years ago

Actually I tried to define data-original-title but this have no effect if title exists it will dropped and moved to data-original-title and no luck :(( Maybe you can add option to declare config.title has more priority than title?

mistic100 commented 4 years ago

Confirmation relies on default implementation of getTitle() form Bootstrap. I don't want to owerride it.

solomax commented 4 years ago

I always thought of title as of something being displayed on hover (describing current element) Confirmation is actually something acting on-click,

will try to find something that can do the job for me Thanks for your time