Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/re621/re621
Browse files Browse the repository at this point in the history
  • Loading branch information
Earlopain committed Apr 5, 2020
2 parents 9915b30 + 32c7249 commit cf9bd95
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/js/components/structure/DomUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ export class DomUtilities {
// Subscribe button container
$("<span>").addClass("tag-action-subscribe").appendTo($actionsBox);
});

/** Wrap the post description textareas in FormattingHelper compatible tags */
if (Page.matches(PageDefintion.upload) || Page.matches(PageDefintion.post)) {
const $textarea = $("textarea#post_description");

$("<div>")
.addClass("dtext-previewable")
.append($(`<div class="dtext-preview">`))
.insertBefore($textarea)
.append($textarea)
.wrap(`<form class="simple_form"></form>`);
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/general/FormattingHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class FormattingHelper {
this.$container.attr("data-editing", "true");
this.$container.attr("data-drawer", "false");

this.$form = this.$container.parents("form.simple_form");
this.$form = this.$container.parents("form.simple_form").first();
this.$textarea = this.$container.find("textarea");
this.$preview = this.$container.find("div.dtext-preview");

Expand Down
2 changes: 1 addition & 1 deletion src/scss/modules/_formatting-helper.scss
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ form.formatting-helper {
&[data-editing=false] div.comment-buttons,
&[data-editing=false] div.settings-buttons,
&[data-editing=false] textarea {
display: none;
display: none !important;
}

&[data-editing=false] div.dtext-preview {
Expand Down

0 comments on commit cf9bd95

Please sign in to comment.