Skip to content

Commit

Permalink
Fix error message in addAttributesToSVGElement plugin
Browse files Browse the repository at this point in the history
Ref #1352
  • Loading branch information
TrySound committed Feb 20, 2021
1 parent 8d7cfa0 commit c1edce4
Showing 1 changed file with 32 additions and 25 deletions.
57 changes: 32 additions & 25 deletions plugins/addAttributesToSVGElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,44 @@ var ENOCLS = `Error in plugin "addAttributesToSVGElement": absent parameters.
It should have a list of "attributes" or one "attribute".
Config example:
plugins:
- addAttributesToSVGElement:
attribute: "mySvg"
plugins: [
{
name: 'addAttributesToSVGElement',
params: {
attribute: "mySvg"
}
}
]
plugins:
- addAttributesToSVGElement:
attributes: ["mySvg", "size-big"]
plugins: [
{
name: 'addAttributesToSVGElement',
params: {
attributes: ["mySvg", "size-big"]
}
}
]
plugins:
- addAttributesToSVGElement:
attributes:
- focusable: false
- data-image: icon`;
plugins: [
{
name: 'addAttributesToSVGElement',
params: {
attributes: [
{
focusable: false
},
{
'data-image': icon
}
]
}
}
]
`

/**
* Add attributes to an outer <svg> element. Example config:
*
* plugins:
* - addAttributesToSVGElement:
* attribute: 'data-icon'
*
* plugins:
* - addAttributesToSVGElement:
* attributes: ['data-icon', 'data-disabled']
*
* plugins:
* - addAttributesToSVGElement:
* attributes:
* - focusable: false
* - data-image: icon
*
* @author April Arcus
*/
exports.fn = function(data, params) {
Expand Down

0 comments on commit c1edce4

Please sign in to comment.