|
Last change
on this file since cdcff72 was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
690 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | exports.type = 'perItemReverse';
|
|---|
| 4 |
|
|---|
| 5 | exports.active = true;
|
|---|
| 6 |
|
|---|
| 7 | exports.description = 'removes empty container elements';
|
|---|
| 8 |
|
|---|
| 9 | var container = require('./_collections').elemsGroups.container;
|
|---|
| 10 |
|
|---|
| 11 | /**
|
|---|
| 12 | * Remove empty containers.
|
|---|
| 13 | *
|
|---|
| 14 | * @see http://www.w3.org/TR/SVG/intro.html#TermContainerElement
|
|---|
| 15 | *
|
|---|
| 16 | * @example
|
|---|
| 17 | * <defs/>
|
|---|
| 18 | *
|
|---|
| 19 | * @example
|
|---|
| 20 | * <g><marker><a/></marker></g>
|
|---|
| 21 | *
|
|---|
| 22 | * @param {Object} item current iteration item
|
|---|
| 23 | * @return {Boolean} if false, item will be filtered out
|
|---|
| 24 | *
|
|---|
| 25 | * @author Kir Belevich
|
|---|
| 26 | */
|
|---|
| 27 | exports.fn = function(item) {
|
|---|
| 28 |
|
|---|
| 29 | return !(item.isElem(container) && !item.isElem('svg') && item.isEmpty() &&
|
|---|
| 30 | (!item.isElem('pattern') || !item.hasAttrLocal('href')));
|
|---|
| 31 |
|
|---|
| 32 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.