ikonograph
Advanced tools
Comparing version 4.0.2 to 4.0.3
@@ -1,3 +0,3 @@ | ||
<a name="4.0.2"></a> | ||
## [4.0.2](https://github.com/contactlab/ikonograph/compare/v3.1.0...v4.0.2) (2017-08-08) | ||
<a name="4.0.3"></a> | ||
## [4.0.3](https://github.com/contactlab/ikonograph/compare/v3.1.0...v4.0.3) (2017-08-16) | ||
@@ -8,2 +8,3 @@ | ||
* better management of icon non existent or not specified ([#35](https://github.com/contactlab/ikonograph/issues/35)) ([b191df6](https://github.com/contactlab/ikonograph/commit/b191df6)) | ||
* Fix throw error blocking parse ([d26c3b6](https://github.com/contactlab/ikonograph/commit/d26c3b6)) | ||
* fixed broken behaviour for style attribute ([#40](https://github.com/contactlab/ikonograph/issues/40)) ([c72a24b](https://github.com/contactlab/ikonograph/commit/c72a24b)) | ||
@@ -10,0 +11,0 @@ |
{ | ||
"name": "ikonograph", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "Icons library by Contactlab", | ||
@@ -5,0 +5,0 @@ "main": "./dist/ikonograph.min.css", |
@@ -6,2 +6,3 @@ const ICONS_SVG = { | ||
const MIME_TYPE = 'image/svg+xml'; | ||
const ICON_DEFAULT = 'agenda'; | ||
const ICON_ATTR = 'icon'; | ||
@@ -40,6 +41,2 @@ const SIZE_ATTR = 'size'; | ||
if (!iconName) { | ||
this._setIcon(iconName); | ||
} | ||
this._addStyleChild(size, color); | ||
@@ -116,8 +113,8 @@ } | ||
_addSVGChild(icon) { | ||
const svgIconString = ICONS_SVG[icon]; | ||
if (!svgIconString) { | ||
throw new Error('The specified icon does not exist'); | ||
if (!ICONS_SVG[icon]) { | ||
console.warn('Ikonograph: The specified icon does not exist'); | ||
} | ||
const svgElement = new DOMParser().parseFromString(ICONS_SVG[icon], MIME_TYPE); | ||
const currentIcon = ICONS_SVG[icon] || ICONS_SVG[ICON_DEFAULT]; | ||
const svgElement = new DOMParser().parseFromString(currentIcon, MIME_TYPE); | ||
svgElement.documentElement.removeAttribute('width'); | ||
@@ -124,0 +121,0 @@ svgElement.documentElement.removeAttribute('height'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1239058
0
4590