Skip to content

Commit

Permalink
Fixed IE
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyschudel committed May 29, 2013
1 parent a567526 commit 58938ad
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsvg",
"version": "0.5.9",
"version": "0.6.0",
"main": "jsvg.js",
"dependencies": {
"jquery": "~1.9.1"
Expand Down
18 changes: 12 additions & 6 deletions dist/jsvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (!('$sa' in window)) {
},
assets = {};

this.VERSION = '0.5.9';
this.VERSION = '0.6.0';

this.init = function() {
$.extend(true, options, options_);
Expand Down Expand Up @@ -128,9 +128,9 @@ if (!('$sa' in window)) {
suffix : ''
},

alterId, unifyIds, getNodeText;
addClass, alterId, unifyIds, getNodeText;

this.VERSION = '0.5.9';
this.VERSION = '0.6.0';

this.init = function() {
$.extend(true, options, options_);
Expand Down Expand Up @@ -227,11 +227,11 @@ if (!('$sa' in window)) {

// custom class
if (opt.className) {
$sprite[0].classList.add(opt.className);
addClass($sprite[0], opt.className);
}

// copy id to class
$sprite[0].classList.add(id);
addClass($sprite[0], id);

return $sprite;
};
Expand All @@ -250,6 +250,12 @@ if (!('$sa' in window)) {

/* --- private --- */

addClass = function(el, cls) {
var current = el.className.baseVal;

return el.className.baseVal = _trim(current+' '+cls);
};

alterId = function(id, opt_) {
var
opt = $.extend({
Expand Down Expand Up @@ -278,7 +284,7 @@ if (!('$sa' in window)) {

$sprite.find('[id]').each(function(index, item) {
if (options.copyIdsToClasses) {
item.classList.add(item.id);
addClass(item, item.id);
}
ids.push(item.id);
});
Expand Down
2 changes: 1 addition & 1 deletion dist/jsvg.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions src/sa.svgasset.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
suffix : ''
},

alterId, unifyIds, getNodeText;
addClass, alterId, unifyIds, getNodeText;

this.VERSION = '0.5.9';
this.VERSION = '0.6.0';

this.init = function() {
$.extend(true, options, options_);
Expand Down Expand Up @@ -150,11 +150,11 @@

// custom class
if (opt.className) {
$sprite[0].classList.add(opt.className);
addClass($sprite[0], opt.className);
}

// copy id to class
$sprite[0].classList.add(id);
addClass($sprite[0], id);

return $sprite;
};
Expand All @@ -173,6 +173,12 @@

/* --- private --- */

addClass = function(el, cls) {
var current = el.className.baseVal;

return el.className.baseVal = _trim(current+' '+cls);
};

alterId = function(id, opt_) {
var
opt = $.extend({
Expand Down Expand Up @@ -201,7 +207,7 @@

$sprite.find('[id]').each(function(index, item) {
if (options.copyIdsToClasses) {
item.classList.add(item.id);
addClass(item, item.id);
}
ids.push(item.id);
});
Expand Down
2 changes: 1 addition & 1 deletion src/sa.svgloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
assets = {};

this.VERSION = '0.5.9';
this.VERSION = '0.6.0';

this.init = function() {
$.extend(true, options, options_);
Expand Down

0 comments on commit 58938ad

Please sign in to comment.