v0.5.0
This is a major update to the v0.4.0 and has some breaking changes. Here's the list of related tickets.
Changes
- .offsetParent() method was renamed to .containingBlock(). The reason for this was that the method was refactored thoroughly and as a result it does not match the description of elem.offsetParent anymore. However, it does match the description of the containing block. This method is pretty neat because it't smart enough to recognize if the browser leaks fixed elements from within transformed elements (against the spec) and returns correct results in all modern browsers (IE9+).
- .intersection() method now accepts two or more elements.
- .place() method's options were refactored quite a lot, so you might want to check that out.
"core"
edge layer was renamed to"content"
. Affects all methods which allow defining the element's edge layer. This is now more in line with W3C spec.- .offset() method learned a new trick: you can now use an alternative syntax and define which element the offset is measured from. Use it like this:
mezr.offset([elem, 'content'], [otherElem, 'padding'])
. The old syntax is still supported and not going anywhere. - .rect() was introduced and it's meant to mimic the behaviour of the elem.getBoundingClientRect(), but with a bit more options =)
- Unit tests were overhauled and updated.
Generally speaking, things are looking good and this should be a pretty solid release. This could have easily been granted v1.0.0 status, but I want to add a few more features before bumping the version all the way up there.
Happy _mezr_ing!