Skip to content

Commit

Permalink
PLT-5484 Reduced scope of CSS rules for (edited) tag (#5599)
Browse files Browse the repository at this point in the history
* PLT-5484 Reduced scope of CSS rules for (edited) tag

* Reverted accidental change from div tags to spans
  • Loading branch information
hmhealey authored and jwilander committed Mar 3, 2017
1 parent 7016c6b commit ca4181b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 34 deletions.
11 changes: 3 additions & 8 deletions webapp/components/post_view/components/post_message_view.jsx
Expand Up @@ -78,7 +78,7 @@ export default class PostMessageView extends React.Component {
}

return (
<span className='edited'>
<span className='post-edited-indicator'>
<FormattedMessage
id='post_message_view.edited'
defaultMessage='(edited)'
Expand All @@ -93,13 +93,7 @@ export default class PostMessageView extends React.Component {
}

if (!this.props.enableFormatting) {
return (
<span>
{this.props.post.message}
&nbsp;
{this.renderEditedIndicator()}
</span>
);
return <span>{this.props.post.message}</span>;
}

const options = Object.assign({}, this.props.options, {
Expand All @@ -119,6 +113,7 @@ export default class PostMessageView extends React.Component {
return (
<div>
<span
className='post-message__text'
onClick={Utils.handleFormattedTextClick}
dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.props.post.message, options)}}
/>
Expand Down
36 changes: 10 additions & 26 deletions webapp/sass/layout/_post.scss
Expand Up @@ -648,17 +648,8 @@
}

p + p {
margin: 1em 0;

&:last-of-type {
margin-bottom: 0;
}
}

span {
> p:first-child {
margin-bottom: 1em;
}
margin-bottom: 1em;
margin-top: 1em;
}

ol,
Expand Down Expand Up @@ -742,10 +733,14 @@
}

.post--edited {
p {
&:last-child {
display: inline-block;
}
// If the last paragraph of an edited post is a paragraph, make it inline-block so that the (edited) indicator can be on the same line as it
.post-message__text > p:last-child {
display: inline-block;
}

.post-edited-indicator {
@include opacity(.6);
font-size: .87em;
}
}

Expand Down Expand Up @@ -1041,10 +1036,6 @@

p + p {
margin: 1.2em 0 0;

&:last-of-type {
margin-bottom: 0;
}
}

img {
Expand Down Expand Up @@ -1129,13 +1120,6 @@
}
}

span {
&.edited {
@include opacity(.6);
font-size: .87em;
}
}

.post-reaction-list {
min-height: 30px;
}
Expand Down

0 comments on commit ca4181b

Please sign in to comment.