aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/ParagraphNodeSpec.ts
diff options
context:
space:
mode:
authorMohammad Amoush <47069173+mamoush34@users.noreply.github.com>2020-01-19 15:15:53 +0300
committerMohammad Amoush <47069173+mamoush34@users.noreply.github.com>2020-01-19 15:15:53 +0300
commit7683e1fbb53fe683c0d04e537d89fb53d768e852 (patch)
treed81eebcd5a129550a49fdfc852b8bb6220907a1a /src/client/util/ParagraphNodeSpec.ts
parentf4382d73eec75f7d7f4bfe6eae3fb1efa128a021 (diff)
parentaff9cc02750eb032ade98d77cf9ff45677063fc8 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into webcam_mohammad
Diffstat (limited to 'src/client/util/ParagraphNodeSpec.ts')
-rw-r--r--src/client/util/ParagraphNodeSpec.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/util/ParagraphNodeSpec.ts b/src/client/util/ParagraphNodeSpec.ts
index 3a993e1ff..0a3b68217 100644
--- a/src/client/util/ParagraphNodeSpec.ts
+++ b/src/client/util/ParagraphNodeSpec.ts
@@ -34,6 +34,7 @@ const ParagraphNodeSpec: NodeSpec = {
color: { default: null },
id: { default: null },
indent: { default: null },
+ inset: { default: null },
lineSpacing: { default: null },
// TODO: Add UI to let user edit / clear padding.
paddingBottom: { default: null },
@@ -76,6 +77,7 @@ function toDOM(node: Node): DOMOutputSpec {
const {
align,
indent,
+ inset,
lineSpacing,
paddingTop,
paddingBottom,
@@ -105,6 +107,14 @@ function toDOM(node: Node): DOMOutputSpec {
style += `padding-bottom: ${paddingBottom};`;
}
+ if (indent) {
+ style += `text-indent: ${indent}; padding-left: ${indent < 0 ? -indent : undefined};`;
+ }
+
+ if (inset) {
+ style += `margin-left: ${inset}; margin-right: ${inset};`;
+ }
+
style && (attrs.style = style);
if (indent) {