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

Popup enforces "btn-sm" for custom buttons #104

Closed
kikonen opened this issue Mar 21, 2019 · 2 comments
Closed

Popup enforces "btn-sm" for custom buttons #104

kikonen opened this issue Mar 21, 2019 · 2 comments

Comments

@kikonen
Copy link

kikonen commented Mar 21, 2019

I'm trying to use custom buttons, but effect is not desired since following styling enforcedly applied always

var BTN_CLASS_DEFAULT = 'btn btn-sm h-100 d-flex align-items-center';
....
    _proto._setCustomButtons = function _setCustomButtons($tip) {
      var self = this;
      var $group = $tip.find(Selector.BUTTONS).empty();
      this.config.buttons.forEach(function (button) {
        var btn = $('<a href="#"></a>').addClass(BTN_CLASS_DEFAULT).addClass(button.class || 'btn btn-secondary').html(button.label || '').attr(button.attr || {});
...

i.e. buttons are enforced to be "btn-sm"

@kikonen
Copy link
Author

kikonen commented Mar 21, 2019

okey, seemingly with custom buttons that is right now not doable, for "standard buttons" via changing "template" seemingly possible to make it work.

However, requires then manually encoding extra data attributes & al. directly into template.

read: would be better if "BTN_CLASS_DEFAULT" would be configurable.

sidenote: however, I might this workaround anyway in order to add data attributes into popup itself.

@mistic100
Copy link
Owner

@kikonen Can you give a try to this commit (not published on NPM).

I reworked how the classes are applied on buttons, this will be published as 4.1.0.
Now every custom buttons classes (for standard and custom buttons) must contain the "btn" class and the "btn-sm" if one want to have smaller buttons.

mistic100 added a commit that referenced this issue Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants