ryanve / response.js

Responsive design toolkit
http://responsejs.com
Other
801 stars 123 forks source link

If prefix property ends with a hyphen, script changes src attrib to 'null' #21

Closed seajones closed 11 years ago

seajones commented 11 years ago

Just using this code:

R.create({
    "prop": "width",
    "prefix": "src- src",
    "breakpoints": [320, 481, 641, 961, 1025, 1281]
});

Where R is within a closure, and alias to Response.

If the prefix property reads "src- src" (to make data-src320 and data-src-320 work for example) it works fine, but if the prefixes are swapped around thus:

R.create({
    "prop": "width",
    "prefix": "src src-",
    "breakpoints": [320, 481, 641, 961, 1025, 1281]
});

The src attributes, when changed by Response, are changed to read 'null'

Just a little thing, and mostly I'm posting this so users can spot this issue if it occurs for them.

ryanve commented 11 years ago

25 is the same issue. Let's handle it there where there's more info.