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

Partially backport #32217 #32225

Merged
merged 2 commits into from
Nov 25, 2020
Merged

Conversation

rohit2sharma95
Copy link
Contributor

@rohit2sharma95 rohit2sharma95 commented Nov 21, 2020

Partially backport #32217

@rohit2sharma95 rohit2sharma95 requested a review from a team as a code owner November 21, 2020 10:38
@XhmikosR
Copy link
Member

I'm confused with the backports :/

@@ -734,10 +734,6 @@ class Tooltip {
this.config.animation = initConfigAnimation
}

_getCustomClass() {
return this.element.getAttribute('data-custom-class') || this.config.customClass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this not needed? 😵

Copy link
Contributor Author

@rohit2sharma95 rohit2sharma95 Nov 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the customClass will be in the configuration already, even if it is provided in the data attributes 🤔

bootstrap/js/src/tooltip.js

Lines 660 to 664 in 2d8c02e

config = {
...this.constructor.Default,
...dataAttributes,
...(typeof config === 'object' && config ? config : {})
}

Ref: #32217 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And jQuery's addClass() method will handle it, either this.config.customClass is a function or a class name (Even it is a blank string)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep good catch 👌

@rohit2sharma95
Copy link
Contributor Author

rohit2sharma95 commented Nov 21, 2020

I'm confused with the backports :/

These are not exactly the backports but minor fixes 🙂

@XhmikosR
Copy link
Member

@rohit2sharma95 can you move the typo fixes to a new PR please?

@rohit2sharma95 rohit2sharma95 force-pushed the tooltip-custom-class-v4 branch from 1a610a7 to 2a45ea9 Compare November 24, 2020 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants