madrobby/zepto — Issue #345: wrap / wrapAll incorrectly implemented
Author: ollym
Created: 2011-11-29 15:10:50+00:00
State: open

Introduced here:
https://github.com/madrobby/zepto/pull/167

wrapAll needs to wrap around all elements matched by the selector. Logic:
Find element with the least amount of parents and wrap it with the wrapping parameter.

wrap shouldn't call wrapAll - they're completely different. The current implementation will only wrap the first element as it stands.

wrapInner logic will therefore be: this.children().wrap(wrapper);

I'm surprised you let it through - the tests are completely bogus too.
Do you wan't me to put this in a patch?