From 2bcd57ca3776a026786c0812206a17d4f1aeae19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ulrich-Matthias=20Sch=C3=A4fer?= Date: Mon, 26 Oct 2015 23:06:32 +0100 Subject: [PATCH] update readme and changelog --- CHANGELOG.md | 4 ++-- README.md | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24a3509..a231a95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,6 @@ - make transform-methods relative as default (breaking change) - added `'random'` option and `randomize()` method to `SVG.Color` -> __TODO!__ -- added `parents()` method to get an array of all parenting elements -> __TODO!__ - added `enqueue()` method to `SVG.FX` -> __TODO!__ - fixed a bug in clipping and masking where empty nodes persists after removal -> __TODO!__ - fixed a bug in IE11 with `mouseenter` and `mouseleave` -> __TODO!__ @@ -16,7 +15,8 @@ - added `ungroup()/flatten()` (#238), `toParent()` and `toDoc()` - added UMD-Wrapper with possibility to pass custom window object (#352) - added `morph()` method via plugin [svg.pathmorphing.js](https://github.com/Fuzzyma/svg.pathmorphing.js) -- added support for css selectors with the `parent()` method +- added support for css selectors within the `parent()` method +- added `parents()` method to get an array of all parenting elements # 2.1.1 (03/10/2015) diff --git a/README.md b/README.md index c22f633..290081e 100644 --- a/README.md +++ b/README.md @@ -974,6 +974,21 @@ var rect = draw.rect(100, 100) rect.doc() //-> returns draw ``` +### parents() +To get all ancestors of the element filtered by type or css selector (see `parent()` method) + +```javascript +var group1 = draw.group().addClass('test') + , group2 = group1.group() + , rect = group2.rect(100,100) + +rect.parents() // returns [group1, group2, draw] +rect.parents('.test') // returns [group1] +rect.parents(SVG.G) // returns [group1, group2] +``` + +__`returns`: `Array`__ + ## Child references ### first() -- 2.39.5