Skip to content

Commit

Permalink
Merge pull request svg#202 from DanielMazurkiewicz/patch-1
Browse files Browse the repository at this point in the history
Update cleanupIDs.js
  • Loading branch information
GreLI committed Aug 2, 2014
2 parents b5eeb69 + 72a7186 commit 44dd73f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugins/cleanupIDs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ exports.active = true;

exports.params = {
remove: true,
minify: true
minify: true,
prefix: ''
};

var referencesProps = require('./_collections').referencesProps,
Expand Down Expand Up @@ -123,7 +124,7 @@ exports.fn = function(data, params) {
// replace referenced IDs with the minified ones
if (params.minify) {

currentIDstring = getIDstring(currentID = generateID(currentID));
currentIDstring = getIDstring(currentID = generateID(currentID), params);
IDs[k].attr('id').value = currentIDstring;

referencesIDs[k].forEach(function(attr) {
Expand Down Expand Up @@ -190,9 +191,9 @@ function generateID(currentID) {
* @param {Array} arr input ID array
* @return {String} output ID string
*/
function getIDstring(arr) {
function getIDstring(arr, params) {

var str = '';
var str = params.prefix;

arr.forEach(function(i) {
str += generateIDchars[i];
Expand Down

0 comments on commit 44dd73f

Please sign in to comment.