1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/renderkid/lib/renderKid/styleApplier/inline.js

31 lines
832 B
JavaScript
Raw Permalink Normal View History

2024-01-16 21:26:16 +08:00
"use strict";
// Generated by CoffeeScript 2.5.1
2023-12-18 13:12:25 +08:00
var _common, inlineStyleApplier, self, tools;
tools = require('../../tools');
_common = require('./_common');
module.exports = inlineStyleApplier = self = {
2024-01-16 21:26:16 +08:00
applyTo: function applyTo(el, style) {
2023-12-18 13:12:25 +08:00
var ret;
ret = _common.getStyleTagsFor(style);
2024-01-16 21:26:16 +08:00
2023-12-18 13:12:25 +08:00
if (style.marginLeft != null) {
2024-01-16 21:26:16 +08:00
ret.before = tools.repeatString("&sp;", parseInt(style.marginLeft)) + ret.before;
2023-12-18 13:12:25 +08:00
}
2024-01-16 21:26:16 +08:00
2023-12-18 13:12:25 +08:00
if (style.marginRight != null) {
ret.after += tools.repeatString("&sp;", parseInt(style.marginRight));
}
2024-01-16 21:26:16 +08:00
2023-12-18 13:12:25 +08:00
if (style.paddingLeft != null) {
ret.before += tools.repeatString("&sp;", parseInt(style.paddingLeft));
}
2024-01-16 21:26:16 +08:00
2023-12-18 13:12:25 +08:00
if (style.paddingRight != null) {
2024-01-16 21:26:16 +08:00
ret.after = tools.repeatString("&sp;", parseInt(style.paddingRight)) + ret.after;
2023-12-18 13:12:25 +08:00
}
2024-01-16 21:26:16 +08:00
2023-12-18 13:12:25 +08:00
return ret;
}
2024-01-16 21:26:16 +08:00
};