diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-03-16 13:15:04 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-03-16 13:15:04 +0100 |
commit | 5c287c95a38f3f05921ba6e1b49e702972cc8467 (patch) | |
tree | e799b5c8458091d23452e91cd220caf9164c8cd6 /dist/svg.js | |
parent | aa8dcdbc571585ce8a957e49271babda88384096 (diff) | |
download | svg.js-5c287c95a38f3f05921ba6e1b49e702972cc8467.tar.gz svg.js-5c287c95a38f3f05921ba6e1b49e702972cc8467.zip |
fixes bug in style when css string ends with ;
Diffstat (limited to 'dist/svg.js')
-rw-r--r-- | dist/svg.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/dist/svg.js b/dist/svg.js index 7be66b5..d9e927a 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -6,7 +6,7 @@ * @copyright Wout Fierens <wout@mick-wout.com> * @license MIT * -* BUILT: Wed Mar 15 2017 11:31:52 GMT+0100 (Mitteleuropäische Zeit) +* BUILT: Thu Mar 16 2017 13:14:11 GMT+0100 (Mitteleuropäische Zeit) */; (function(root, factory) { if (typeof define === 'function' && define.amd) { @@ -3050,12 +3050,14 @@ SVG.extend(SVG.Element, { } else if (SVG.regex.isCss.test(s)) { // parse css string - s = s.split(';') + s = s.split(/\s*;\s*/) + // filter out suffix ; and stuff like ;; + .filter(function(e) { return !!e }) + .map(function(e){ return e.split(/\s*:\s*/) }) // apply every definition individually - for (var i = 0; i < s.length; i++) { - v = s[i].split(':') - this.style(v[0].replace(/\s+/g, ''), v[1]) + while (v = s.pop()) { + this.style(v[0], v[1]) } } else { // act as a getter if the first and only argument is not an object |