Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract a few changes from the Mithril 2 upgrade #2262

Merged
merged 5 commits into from
Aug 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions js/src/common/components/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ export default class Modal extends Component {
this.$('form').find('input, select, textarea').first().focus().select();
}

onhide() {}

/**
* Hide the modal.
*/
Expand Down
2 changes: 1 addition & 1 deletion js/src/forum/components/Composer.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default class Composer extends Component {
});

// When the escape key is pressed on any inputs, close the composer.
this.$().on('keydown', ':input', 'esc', () => this.close());
this.$().on('keydown', ':input', 'esc', () => this.state.close());

const handlers = {};

Expand Down
6 changes: 0 additions & 6 deletions js/src/forum/components/PostStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ export default class PostStream extends Component {
}

view() {
function fadeIn(element, isInitialized, context) {
if (!context.fadedIn) $(element).hide().fadeIn();
context.fadedIn = true;
}

let lastTime;

const viewingEnd = this.stream.viewingEnd();
Expand All @@ -45,7 +40,6 @@ export default class PostStream extends Component {
content = PostComponent ? PostComponent.component({ post }) : '';

attrs.key = 'post' + post.id();
attrs.config = fadeIn;
attrs['data-time'] = time.toISOString();
attrs['data-number'] = post.number();
attrs['data-id'] = post.id();
Expand Down
2 changes: 1 addition & 1 deletion js/src/forum/components/SignUpModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export default class SignUpModal extends Modal {
* Get the data that should be submitted in the sign-up request.
*
* @return {Object}
* @public
* @protected
*/
submitData() {
const data = {
Expand Down
11 changes: 11 additions & 0 deletions less/forum/PostStream.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@
margin-top: 10px;
}
}

@-webkit-keyframes fadeIn {
0% {opacity: 0}
100% {opacity: 1}
}
@keyframes fadeIn {
0% {opacity: 0}
100% {opacity: 1}
}
.PostStream-item {
.animation(fadeIn 0.6s ease-in-out);

&:not(:last-child) {
border-bottom: 1px solid @control-bg;

Expand Down