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

Attachment of multiple CSS Classes #131

Open
thexmanxyz opened this issue Nov 8, 2017 · 1 comment
Open

Attachment of multiple CSS Classes #131

thexmanxyz opened this issue Nov 8, 2017 · 1 comment

Comments

@thexmanxyz
Copy link

thexmanxyz commented Nov 8, 2017

Hey there,

I noticed a bug with the parameters activeClass and pagerClass. As soon as I define a custom class for pagerClass the activeClass wouldn't be rendered to the DOM. I'm not sure if this intended, however let's assume the following example:

jQuery('#some-slider').slippry({
  slippryWrapper: '<div class="sy-box" />',
  adaptiveHeight: false, 
  useCSS: true,
  autoHover: false,
  transition: 'horizontal',
  pagerClass: 'sy-pager xyz',
  activeClass: 'sy-active abc',
  auto: true
});

The above example would not render 'sy-active abc' for the class, it would simply render no class attribute and no class.

Moreover, I noticed not the overwrite alone causes the issue. If just 'sy-pager' is defined for the pagerClass it works as expected. Only if you change to a non default value the activeClass wouldn't be rendered out.

Edit: I noticed it's not related to the default value. It's the blank in pagerClass which causes the issue. Just custom strings work but a blank within the pagerClass strips out the activeClass.

@thexmanxyz
Copy link
Author

thexmanxyz commented Nov 8, 2017

Ok I'm already seeing what's the issue. It's not intended for multiple class attachments. The JS code is not prepared for that. In this case it does not replace blanks with "." or split everything after the blank out to get the correct selector rule(s). I would issue a pull request which fixes the problem if you want to fix that issue for all custom class bindings to support multi class attachments? Just let me know.

Generally speaking, this would be great because then we can keep the existing classes and just attach new ones for new rules which is better for overrides because otherwise it's necessary to double the CSS for modifications or even put it on the main container like in my case.

@thexmanxyz thexmanxyz changed the title activeClass vs. pagerClass Attachment of multiple CSS Classes Nov 9, 2017
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