inline.js 832 B

12345678910111213141516171819202122232425262728293031
  1. "use strict";
  2. // Generated by CoffeeScript 2.5.1
  3. var _common, inlineStyleApplier, self, tools;
  4. tools = require('../../tools');
  5. _common = require('./_common');
  6. module.exports = inlineStyleApplier = self = {
  7. applyTo: function applyTo(el, style) {
  8. var ret;
  9. ret = _common.getStyleTagsFor(style);
  10. if (style.marginLeft != null) {
  11. ret.before = tools.repeatString("&sp;", parseInt(style.marginLeft)) + ret.before;
  12. }
  13. if (style.marginRight != null) {
  14. ret.after += tools.repeatString("&sp;", parseInt(style.marginRight));
  15. }
  16. if (style.paddingLeft != null) {
  17. ret.before += tools.repeatString("&sp;", parseInt(style.paddingLeft));
  18. }
  19. if (style.paddingRight != null) {
  20. ret.after = tools.repeatString("&sp;", parseInt(style.paddingRight)) + ret.after;
  21. }
  22. return ret;
  23. }
  24. };