inline.js 811 B

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