Update jquery.scrollTo.js #98

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@AndrewEastwood

We really need this because when the val is null then condition returns true (because of typeof null == 'object'), and the both function returns null value which is set to offset variable. Later we have the following line #118 attr[key] += offset[pos] || 0; and as the offset is null we get error message (totally sad face goes here).

@AndrewEastwood AndrewEastwood Update jquery.scrollTo.js
We really need this because when the `val` is `null` then condition returns `true` (because of `typeof null == 'object'`), and the `both` function returns `null` value which is set to `offset` variable. Later we have the following line #118 `attr[key] += offset[pos] || 0;` and as the `offset` is `null` we get error message (totally sad face goes here).
a8f7f85
@flesler flesler added a commit that closed this pull request Nov 20, 2014
@flesler Closes #98
both() now handles nulls correctly
Updated jquery requirement to >= 1.4
025405d
@flesler flesler closed this in 025405d Nov 20, 2014
@flesler
Owner
flesler commented Nov 20, 2014

I changed it to use jQuery.isPlainObject() just because that's what I expected the code to do.
You didn't actually explain what's the case where val can be null and why it should be "legal" though.

@AndrewEastwood

the isPlainObject just works great! thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment