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

Interchange and generated rules #8335

Closed
bredele opened this issue Mar 4, 2016 · 3 comments
Closed

Interchange and generated rules #8335

bredele opened this issue Mar 4, 2016 · 3 comments

Comments

@bredele
Copy link

bredele commented Mar 4, 2016

Hi,

My team and I would like to use the interchange plugin but we noticed an error in the [generatedRules](https://github.com/zurb/foundation-sites/blob/develop/js/foundation.interchange.js#L104) handler. Here's our HTML code:

<img data-interchange="[/path/to/bigger-image.jpg, (large)]">

This method is trying to loop over an array using the for in loop and so, slice some of the array prototype functions.

Thanks for your help.

@bredele bredele closed this as completed Mar 4, 2016
@bredele bredele reopened this Mar 4, 2016
@bredele
Copy link
Author

bredele commented Mar 4, 2016

Just some extra information, we (unfortunately) use extjs which overrides some native methods of the Array prototype and add other methods such as remove.

@jayoakum
Copy link

I had the same issue with a similar library.
I was able to get this working for me by wrapping the contents of 'for each' blocks with a hasOwnProperty check.

    for (var i in rules) {
      if (rules.hasOwnProperty(i)) {
          // original code
      }
    }

Note: There are several 'for each' blocks in the script.

@colin-marshall
Copy link
Contributor

Closed in #8686. Thanks @jyoakum-swx for the solution!

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

4 participants