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

Refactored messages.js #1852

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

adamzap
Copy link
Member

@adamzap adamzap commented Dec 28, 2024

  • Simplified code using a combination of CSS and JavaScript
  • Stopped using jQuery
  • Moved refactored code to djangoproject.js

This patch should bring no user-facing changes.

Refs #1827

The easiest way I found to test with was to add the following code to the bottom of blog.views.BlogViewMixin right before the return:

        from django.contrib import messages

        messages.info(self.request, 'abc')
        messages.success(self.request, 'def')

Then test this way:

  1. Navigate to the "News" (/weblog/) section of the site
  2. Dismiss the two message

- Simplified code using a combination of CSS and JavaScript
- Stopped using jQuery
- Moved refactored code to `djangoproject.js`

This patch should bring no user-facing changes.

Refs django#1827
@@ -3416,6 +3416,8 @@ ul.corporate-members li {
color: $green-dark;
border: 1px solid $green-dark;
border-radius: 4px;
opacity: 1;
transition: opacity 400ms;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 400ms value here matches the value in the JavaScript. I'd much prefer using a CSS transition than trying to fade the element out in JavaScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant