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

Can't use multiple custom classes #31

Open
Tadaz opened this issue Nov 5, 2021 · 0 comments
Open

Can't use multiple custom classes #31

Tadaz opened this issue Nov 5, 2021 · 0 comments

Comments

@Tadaz
Copy link

Tadaz commented Nov 5, 2021

Thanks for the great package guys.

One minor issue I found so far, it fails while trying to pass a string or an array containing multiple custom classes.

Example:

new Notify({
        customClass: 'mycustomclass-1 mycustomclass-2'
})

Exception's location:

Notify.prototype.setWrapper = function () {
        var wrapper = document.createElement('div');
        this.wrapper = wrapper;
        this.wrapper.style.setProperty('--gap', this.gap + "px");
        this.wrapper.style.transitionDuration = this.speed + "ms";
        // set classes
        this.wrapper.classList.add('notify');
        this.wrapper.classList.add("notify--type-" + this.type);
        this.wrapper.classList.add("notify--" + this.status);
        if (this.customClass)
            this.wrapper.classList.add(this.customClass); //FAILS HERE
    };

Works fine if you pass only one class though.

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

1 participant