Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer data-* attrib options over initialization options #136

Closed
landy2005 opened this issue Apr 1, 2021 · 2 comments
Closed

Prefer data-* attrib options over initialization options #136

landy2005 opened this issue Apr 1, 2021 · 2 comments

Comments

@landy2005
Copy link

When initialized with any custom options, ie:

          $("[data-toggle='confirm']").confirmation({
            rootSelector: '[data-toggle=confirm]',
            btnOkIcon: 'icon-ok',
            btnOkClass: 'btn btn-sm btn-primary',
            btnCancelIcon: 'icon-remove',
            btnCancelClass: 'btn btn-sm btn-danger',
          });

than not possible override this options in separate tags by data attribs, ie (different data-btn-cancel-class):

<button id="submit" type="submit" data-toggle="confirm" data-btn-cancel-class="btn btn-xs btn-primary" data-title="Confirmation" data-singleton="true" data-popout="true" data-placement="left" data-content="Ignore until ok?" data-original-title="" title=""><i class="icon-ok-sign text-muted" style="margin-right: 0px;"></i></button>
@mistic100
Copy link
Owner

mistic100 commented Apr 1, 2021

It is the default Bootstrap behavior for all options but title and content
example for the trigger option Popover https://jsfiddle.net/7k4sum2r/

but it would make sense for 'btn*' options

@mistic100
Copy link
Owner

config parsing is here in Bootstrap https://github.com/twbs/bootstrap/blob/v4.6.0/js/src/tooltip.js#L660-L664

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants