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 doc-switcher.js #1835

Merged
merged 4 commits into from
Dec 20, 2024
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
6 changes: 6 additions & 0 deletions djangoproject/static/js/djangoproject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Toggle persistent display of documentation version and language options
document.querySelectorAll('.doc-switcher li.current').forEach(function (el) {
el.addEventListener('click', function () {
this.parentElement.classList.toggle('open');
});
});
4 changes: 0 additions & 4 deletions djangoproject/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ define(function () {
mods.push('mod/version-switcher');
}

if (hasClass('doc-switcher')) {
mods.push('mod/doc-switcher');
}

if (hasClass('doc-floating-warning')) {
mods.push('mod/floating-warning');
}
Expand Down
24 changes: 0 additions & 24 deletions djangoproject/static/js/mod/doc-switcher.js

This file was deleted.

1 change: 1 addition & 0 deletions djangoproject/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
};
</script>
<script data-main="{% static "js/main.js" %}" src="{% static "js/lib/require.js" %}"></script>
<script src="{% static "js/djangoproject.js" %}"></script>
{% block body_extra %}{% endblock body_extra %}
</body>
</html>
Loading