main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
791 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | exports.addon = function (renderer) {
|
---|
| 4 | if (process.env.NODE_ENV !== 'production') {
|
---|
| 5 | require('./__dev__/warnOnMissingDependencies')('rule', renderer, ['put', 'decl']);
|
---|
| 6 | }
|
---|
| 7 |
|
---|
| 8 | var decl = renderer.decl;
|
---|
| 9 |
|
---|
| 10 | renderer.decl = function (prop, value) {
|
---|
| 11 | var result = decl(prop, value);
|
---|
| 12 |
|
---|
| 13 | if (value instanceof Array) {
|
---|
| 14 | var pos = result.indexOf(':');
|
---|
| 15 |
|
---|
| 16 | prop = result.substr(0, pos + 1);
|
---|
| 17 |
|
---|
| 18 | result = prop + value.join(';' + prop) + ';';
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | return result;
|
---|
| 22 | };
|
---|
| 23 |
|
---|
| 24 | var put = renderer.put;
|
---|
| 25 |
|
---|
| 26 | renderer.put = function (selector, decls, atrule) {
|
---|
| 27 | if (decls instanceof Array) {
|
---|
| 28 | decls = renderer.assign.apply(null, decls);
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | return put(selector, decls, atrule);
|
---|
| 32 | };
|
---|
| 33 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.