Skip to content

Commit

Permalink
Remove vivus word from the ignore tag
Browse files Browse the repository at this point in the history
Update the documentation to mention the ignore tag.
  • Loading branch information
maxwellito committed Sep 21, 2015
1 parent 12ab3dd commit a2a7458
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
16 changes: 15 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,20 @@ new Vivus('my-svg-id', {

**WARNING**: `animTimingFunction` is called at every frame of the animation, and `pathTimingFunction` is also called at every frame for each path of your SVG. So be careful about them. Keep it simple, or it can affect the performances.

## Extra attributes

The attribute `data-ignore` allow to ignore path tags from the vivus animation.

```html
<svg id="my-svg">
<path...>
<path data-ignore="true" ...>
<path...>
</svg>
```

In this case, the second path won't be part of the animation.

## Scenarize

This feature allows you to script the animation of your SVG. For this, the custom values will be set directly in the DOM of the SVG.
Expand Down Expand Up @@ -264,4 +278,4 @@ var logo = new Vivus('myLogo', {type: 'scenario-sync'});

// The property 'map' contain all the SVG mapping
console.table(logo.map);
```
```
2 changes: 1 addition & 1 deletion src/vivus.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ Vivus.prototype.destroy = function () {
*/
Vivus.prototype.isInvisible = function (el) {
var rect,
ignoreAttr = el.getAttribute('data-vivus-ignore');
ignoreAttr = el.getAttribute('data-ignore');

if (ignoreAttr !== null) {
return ignoreAttr !== 'false';
Expand Down
6 changes: 3 additions & 3 deletions test/unit/vivus.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,18 +326,18 @@ describe('Vivus', function () {
});

it('should not accept a path which with an ignore tag', function () {
svgTag.childNodes[1].setAttribute('data-vivus-ignore', 'true');
svgTag.childNodes[1].setAttribute('data-ignore', 'true');
myVivus = new Vivus(svgTag);
expect(myVivus.map.length).toEqual(5);
});

it('should not accept a path which is not displayed', function () {
svgTag.childNodes[1].setAttribute('data-vivus-ignore', 'false')
svgTag.childNodes[1].setAttribute('data-ignore', 'false')
myVivus = new Vivus(svgTag);
expect(myVivus.map.length).toEqual(6);
});
});

// Drawing
describe('Drawing:', function () {

Expand Down

0 comments on commit a2a7458

Please sign in to comment.