|
@@ -37,8 +37,8 @@ class Editor extends React.PureComponent {
|
|
editor: null,
|
|
editor: null,
|
|
quill: null,
|
|
quill: null,
|
|
rawInput: null,
|
|
rawInput: null,
|
|
- selContentType: "richtext",
|
|
|
|
- contentType: "richtext",
|
|
|
|
|
|
+ selContentType: cs.CampaignContentTypeRichtext,
|
|
|
|
+ contentType: cs.CampaignContentTypeRichtext,
|
|
body: ""
|
|
body: ""
|
|
}
|
|
}
|
|
|
|
|
|
@@ -108,11 +108,11 @@ class Editor extends React.PureComponent {
|
|
|
|
|
|
// Switching from richtext to html.
|
|
// Switching from richtext to html.
|
|
let body = ""
|
|
let body = ""
|
|
- if (this.state.selContentType === "html") {
|
|
|
|
|
|
+ if (this.state.selContentType === cs.CampaignContentTypeHTML) {
|
|
body = this.state.quill.editor.container.firstChild.innerHTML
|
|
body = this.state.quill.editor.container.firstChild.innerHTML
|
|
// eslint-disable-next-line
|
|
// eslint-disable-next-line
|
|
this.state.rawInput.value = body
|
|
this.state.rawInput.value = body
|
|
- } else if (this.state.selContentType === "richtext") {
|
|
|
|
|
|
+ } else if (this.state.selContentType === cs.CampaignContentTypeRichtext) {
|
|
body = this.state.rawInput.value
|
|
body = this.state.rawInput.value
|
|
this.state.quill.editor.clipboard.dangerouslyPasteHTML(body, "raw")
|
|
this.state.quill.editor.clipboard.dangerouslyPasteHTML(body, "raw")
|
|
}
|
|
}
|
|
@@ -135,8 +135,8 @@ class Editor extends React.PureComponent {
|
|
style={{ minWidth: 200 }}
|
|
style={{ minWidth: 200 }}
|
|
value={this.state.selContentType}
|
|
value={this.state.selContentType}
|
|
>
|
|
>
|
|
- <Select.Option value="richtext">Rich Text</Select.Option>
|
|
|
|
- <Select.Option value="html">Raw HTML</Select.Option>
|
|
|
|
|
|
+ <Select.Option value={ cs.CampaignContentTypeRichtext }>Rich Text</Select.Option>
|
|
|
|
+ <Select.Option value={ cs.CampaignContentTypeHTML }>Raw HTML</Select.Option>
|
|
</Select>
|
|
</Select>
|
|
{this.state.contentType !== this.state.selContentType && (
|
|
{this.state.contentType !== this.state.selContentType && (
|
|
<div className="actions">
|
|
<div className="actions">
|
|
@@ -159,7 +159,7 @@ class Editor extends React.PureComponent {
|
|
<ReactQuill
|
|
<ReactQuill
|
|
readOnly={this.props.formDisabled}
|
|
readOnly={this.props.formDisabled}
|
|
style={{
|
|
style={{
|
|
- display: this.state.contentType === "richtext" ? "block" : "none"
|
|
|
|
|
|
+ display: this.state.contentType === cs.CampaignContentTypeRichtext ? "block" : "none"
|
|
}}
|
|
}}
|
|
modules={this.quillModules}
|
|
modules={this.quillModules}
|
|
defaultValue={this.props.record.body}
|
|
defaultValue={this.props.record.body}
|
|
@@ -594,7 +594,7 @@ class Campaign extends React.PureComponent {
|
|
: 0,
|
|
: 0,
|
|
record: {},
|
|
record: {},
|
|
formRef: null,
|
|
formRef: null,
|
|
- contentType: "richtext",
|
|
|
|
|
|
+ contentType: cs.CampaignContentTypeRichtext,
|
|
previewRecord: null,
|
|
previewRecord: null,
|
|
body: "",
|
|
body: "",
|
|
currentTab: "form",
|
|
currentTab: "form",
|